This book concentrates on hands-on development of practical Windows and Web applications that demonstrate C# and VB programming techniques to bring you up to speed on LINQ technologies. The first half of the book covers LINQ Standard Query Operators
在使用EF查询数据的时候,我们常用的查询数据方式有linq to sql,linq to object,
查询返回的结果有两种类型:IQueryable、IEnumerable,两者内部的处理机制是完全不同的。
清楚认识,这里也是一个数据查询的优化点。
在System.linq命名空间,有两个静态类:Queryable和Enumerable.
在System.linq.Queryable中,参数接收的是一个表达式类型,返回IQueryable接口
public static IQueryabl
前言
相信大家对Entity Framework一定不陌生,我相信其中Linq To Sql是其最大的亮点之一,但是我们一直使用到现在却不曾明白内部是如何实现的,今天我们就简单的介绍IQueryable和IQueryProvider。
IQueryable接口
我们先聊聊这个接口,因为我们在使用EF中经常看到linq to sql语句的返回类型是IQueryable,我们可以看下这个接口的结构:
代码如下:
public interface IQueryable :