0
我有UserType对象,其中Name属性值是User属性的UserId,LoginName,Email等等。我需要将UserType对象映射到User对象,并将User映射到UserType。我使用了AutoMapper库,但我无法实现映射。用AutoMapper映射不同的对象
public class UserType
{
public string UserName { get; set; }
public Attribute[] Attribute { get; set; }
}
用户属性类:
public class Attribute
{
public string Name { get; set; }
public string[] Value { get; set; }
}
属性例如:属性属性=新属性{名称= “LoginName将”,值=新[] { “LoginName将”}}
我的用户类:
public class User
{
public long UserId { get; set; }
public string LoginName { get; set; }
public string Email { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
}