1.LINQ的运算符
运算符 | 注解 |
---|---|
join | 内连接 |
from | 每个查询只支持一个from |
where | 查询条件 |
orderby | 排序 |
select | 查询 |
sikp 和 take | 使用服务器端分页支持,sokp值必须大于或等于take |
2.要想使用LINQ要先创建一个新的实例
//n:n的案例
OrganizationServiceContext ora = new OrganizationServiceContext(service);
var linq=from a in ora.CreateQuery("实体名称")
Join b in ora.CreateQuery("实体名称中间表")
on a.aid=b.aid
Join c in ora.CreateQuery("实体名称三")
on b.cid=c.cid
where a["name"].Equals("值")
Orderby a.name ascending
select new{
Name=a.name,
Cid=c.cid
};