我有UserDTO
public class UserDTO
{
public int UsersFundRoleID { get; set; }
public int UserID { get; set; }
public string UserName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string DisplayName { get; set; }
public string Email { get; set; }
public int? FundID { get; set; }
public int RoleID { get; set; }
}
和用户实体
public partial class User
{
public int UserID { get; set; }
public string UserName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public bool IsDisabled { get; set; }
public Nullable<System.DateTime> DisabledDateTime { get; set; }
public virtual ICollection<UsersFundRole> UsersFundRoles { get; set; }
}
我正在尝试更新“ UsersFundRoles”中的“ RoleID”,但由于UsersFundRoles是一个集合,因此无法弄清楚如何正确映射此映射。
到目前为止,我已经尝试过:var user = Mapper.Map<UserDTO, User>(userDto);
但是UsersFundRoles集合为空。