标签:
public List<UserInfoBaseModel> GetNameByIDList(List<int> UserID) { var UserList = LoadRepository<User_Info>() .GetModel() .Where(x => UserID.Contains(x.UserInfoID)) .Select(i => new UserInfoBaseModel() { UserInfoId = i.UserInfoID, UserName = i.UserName }) .ToList(); return UserList; }
Lambda 把查询出来的数据影射成另一个ViewModel
标签:
原文地址:http://www.cnblogs.com/ansheng/p/5217201.html