2014/08/20

Lambda expression, return new elements of ToList() method

IEnumerable<UserModel> users = db.Users.Select(it => new UserModel() {
Email = it.Email,
ForeName = it.ForeName,
Id = it.Id,
ModificationDate = it.ModificationDate,
//..
}).ToList();
view raw gistfile1.cs hosted with ❤ by GitHub

No comments:

Post a Comment