【发布时间】:2012-05-09 15:43:19
【问题描述】:
我有一个Dictionary<User, bool>
用户如下:
public class User {
public string Username { get; set; }
public string Avatar { get; set;
}
第二种类型,bool,表示这个用户是否是登录用户的朋友。
我想将此 Dictionary 展平为List<UserDto> UserDto 定义为:
public class UserDto {
public string Username { get; set; }
public string Avatar { get; set; }
public bool IsFriend { get; set; }
}
IsFriend 表示字典的值。
我该怎么做?
【问题讨论】:
-
如果有人能给我一个实际使用automapper的方法,我会更改问题的答案!
标签: automapper