码迷,mamicode.com
首页 >  
搜索关键字:ienumerator ienumerable iqueryable    ( 750个结果
IEnumerable对象的Distinct方法重写
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) { HashSet<TKey> hashSe ...
分类:编程语言   时间:2019-04-23 11:11:52    阅读次数:153
EF拓展
1 条件判断是否要加过滤条件 public static IQueryable<T> WhereIf<T>( this IQueryable<T> source, Expression<Func<T, bool>> predicate, bool condition) { source.CheckN ...
分类:其他好文   时间:2019-04-11 12:04:28    阅读次数:100
IEnumerable<T>和IQueryable<T>区别
LINQ查询方法一共提供了两种扩展方法,在System.Linq命名空间下,有两个静态类:Enumerable类,它针对继承了IEnumerable<T>接口的集合进行扩展;Queryable类,针对继承了IQueryable<T>接口的集合进行扩展。我们会发现接口IQueryable<T>实际也是 ...
分类:编程语言   时间:2019-04-06 17:12:59    阅读次数:184
C# WinForm DataGridView让DataPropertyName支持复杂属性
首先给Grid添加BindingSource,类型为BindingForForm2。或者设置Grid的DataSource为IEnumerable<BindingForForm2>。 BindingForForm2类型如下。 public class BindingForForm2 { public ...
分类:Windows程序   时间:2019-03-15 19:34:02    阅读次数:332
EF 调用存储过程实例
IQueryable<TPT_ECN_MSTR> q = db.TPT_ECN_MSTRS.AsNoTracking(); if (_OrdDateFr == DateTime.MinValue && _OrdDateTo == DateTime.MaxValue) return q.Where(p ...
分类:其他好文   时间:2019-02-12 12:54:04    阅读次数:318
多个上传
public ActionResult Index(IEnumerable<HttpPostedFileBase> files) { foreach (var file in files) { if (file.ContentLength > 0) { var fileName = Path.Get ...
分类:Web程序   时间:2019-01-20 11:49:28    阅读次数:185
【译】使用 LINQ 合并 IEnumerable 序列
Zip 方法允许把序列中的元素通过交织将 IEnumerable 序列连接在一起。Zip 是一种基于 IEnumerable 的扩展方法。例如,将具有年龄的名称集合压缩在一起: 将会生成包含三个元素的 IEnumerable <string>: image.png image.png 如果一个序列比 ...
分类:编程语言   时间:2019-01-13 02:01:25    阅读次数:189
Entity Framework 查漏补缺 (二)
数据加载 如下这样的一个lamda查询语句,不会立马去查询数据库,只有当需要用时去调用(如取某行,取某个字段、聚合),才会去操作数据库,EF中本身的查询方法返回的都是IQueryable接口。 链接:IEnumerable和IQueryable接口说明 其中聚合函数会影响数据加载,诸如:toList ...
分类:其他好文   时间:2019-01-13 00:13:11    阅读次数:157
【译】《C# 小技巧 -- 编写更优雅的 C#》原书名《C# Tips -- Write Better C#》
【译】《C# 小技巧 -- 编写更优雅的 C#》原书名《C# Tips -- Write Better C#》 目录 介绍(Introduction) 第一部分:各种小技巧(Part 1: Assorted Tips) 使用 LINQ 合并 IEnumerable 序列(Merging IEnume ...
分类:Windows程序   时间:2019-01-13 00:10:47    阅读次数:290
一:Newtonsoft.Json 支持序列化与反序列化的.net 对象类型;
Json.net 序列化程序会将.Net 值转换为json值,表格中是支持转换的对象类型; .net 对象类型 转换后的Json 类型 IList, IEnumerable, IList<T>, Array,datatable json数组 IDictionary, IDictionary<TKey ...
分类:Web程序   时间:2019-01-13 00:08:49    阅读次数:253
750条   上一页 1 ... 6 7 8 9 10 ... 75 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!