linq to SQL link 和in 操作
直接上代码:一看就懂
var query = from c in ctx.Customers
where c.City == "London"
select c;,
var query = from c in ctx.Customers
where c.City.StartsWith("Lo")
select c;
var query = from c in ctx.Customers
where c.City.StartsWith("L") && c.City.Contains("n")
select c;
var query = from c in ctx.Customers
where SqlMethods.Like(c.City, "L_n%")
select c;
相当于SQL语句中的 where 字段名 in()
var ids ={1,2,3};
var query =from item in context.items
where ids.Contains( item.id )
select item;
var result = from col in dt.AsEnumerable() where (new string[] { "Save", "Revocation", "Auditing", "EndAudit" }).Contains(col[name]) select col[name];
把学习一种技术一直坚持下去。