摘要: 1. CASE WHEN ... THEN ...var expr = from p in context.Products select new { 商品ID = p.ProductID, ... 阅读全文
posted @ 2014-10-24 21:51 libingql 阅读(660) 评论(0) 推荐(0) 编辑
摘要: 1. 单一条件查询var expr = context.Products .Where(p => p.ProductName == "LINQ to SQL");SELECT [Extent1].[ProductID] AS [ProductID], [Extent1].[Ca... 阅读全文
posted @ 2014-10-24 15:53 libingql 阅读(12994) 评论(0) 推荐(0) 编辑
摘要: 1. 查询全部字段using (NorthwindContext context = new NorthwindContext()){ var expr = context.Products; foreach (var item in expr) { Console.... 阅读全文
posted @ 2014-10-24 10:15 libingql 阅读(5368) 评论(0) 推荐(0) 编辑