quangdd5757 / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

System.NotSupportedException: The member [User] of type Domain.User cannot be used as a parameter value #166

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
my english is sucks,but i can paste my code.
when i use dapper.Contrib insert method,and my domain class contains another 
domain class.
i get this exception.

public class User
    {
        public int Id { get; set; }
        public string Name { get; set; } 
}

public class UserValidation
    {
        public int Id { get; set; }
        public int UserId { get; set; }
        public string Guid { get; set; } 
        public DateTime CreateOn { get; set; }

        public virtual User User { get; set; } //Notice this
    }

  var userValidation = new UserValidation()
            {
                UserId = 100401,Guid = Guid.NewGuid().ToString(),CreateOn = DateTime.Now
            };
            var userValidationId = _userValidationRepo.Add(userValidation);

Original issue reported on code.google.com by Tin...@gmail.com on 21 Dec 2013 at 2:18