标签:style blog color ar strong sp div on log
1. 单一条件查询
var expr = context.Products .Where(p => p.ProductName == "LINQ to SQL");
SELECT [Extent1].[ProductID] AS [ProductID], [Extent1].[CategoryID] AS [CategoryID], [Extent1].[ProductName] AS [ProductName], [Extent1].[UnitPrice] AS [UnitPrice], [Extent1].[Discontinued] AS [Discontinued] FROM [dbo].[Product] AS [Extent1] WHERE N‘LINQ to SQL‘ = [Extent1].[ProductName]
2. 组合条件查询
var expr = context.Products .Where(p => p.ProductName == "LINQ to SQL" && p.UnitPrice > 10m);
SELECT [Extent1].[ProductID] AS [ProductID], [Extent1].[CategoryID] AS [CategoryID], [Extent1].[ProductName] AS [ProductName], [Extent1].[UnitPrice] AS [UnitPrice], [Extent1].[Discontinued] AS [Discontinued] FROM [dbo].[Product] AS [Extent1] WHERE (N‘LINQ to SQL‘ = [Extent1].[ProductName]) AND ([Extent1].[UnitPrice] > cast(10 as decimal(18)))
标签:style blog color ar strong sp div on log
原文地址:http://www.cnblogs.com/libingql/p/4048520.html