C# EF+Linq & Lambda多条件查询语句

1.Linq单条件查询

var xxfDate = from u in dbContext.Customer

                          where u.Id > 0

                          select u.CusName;

2.Linq多条件查询

var xxfDate = from u in dbContext.Customer

                          where u.Id > 0

                          select new { u.Id,u.CusName};

3.lambda多条件表达式

var xxfData = dbContext.Customer.Where(u => u.Id > 0).Select(u => new { u.Id, xxfLie2 = u.CusName });

猜你喜欢

转载自blog.csdn.net/xoofly/article/details/84317395