Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
对 SQL 数据使用 IEnumerable
返回类型是否有任何陷阱?
我的问题是关于SQL连接状态 负载等 基于以下代码 public IEnumberable
c
sqlserver
IEnumerable
为什么 foreach 找不到我的 GetEnumerator 扩展方法?
我正在努力使一些代码更具可读性 例如foreach var row in table 而不是foreach DataRow row in table Rows 为此 我创建了一个扩展方法 namespace System Data publ
c
foreach
extensionmethods
IEnumerable
请解释 System.Linq.Enumerable.Where(Func
谓词)
对于Where方法的这种重载 我无法理解MSDN文档的任何意义 该重载接受一个具有两个参数的谓词 其中int据说代表源元素的索引 无论这意味着什么 我认为枚举是一个序列 您无法看到比下一个项目更远的内容 更不用说对其进行任何索引了 有人可以
c
LINQ
extensionmethods
IEnumerable
enumerable
为什么 C# 编译器对 double IEnumerable
和 foreach T 感到满意?
我知道这段代码不起作用 并且以有效的方式编写它没有问题 我想知道编译器如何构建而不出现任何错误 如果您在哪里运行它 您会遇到运行时错误吗 假设数据不为空 using System using System Collections Gener
c
NET
foreach
IEnumerable
如何使用反射在 IEnumerable
上调用 System.Linq.Enumerable.Count<>?
我有一堆 IEnumerable 集合 其确切数量和类型经常发生变化 由于自动代码生成 它看起来像这样 public class MyCollections public System Collections Generic IEnumer
c
generics
Reflection
Collections
IEnumerable
在什么情况下我需要为 IEnumerable 和 IQueryable 创建两种不同的扩展方法?
假设我需要一个扩展方法 它仅从不同来源选择所需的属性 源可以是数据库或内存中的集合 所以我定义了这样的扩展方法 public IQueryable
c
NET
LINQ
IEnumerable
iqueryable
Linq to SQL 中的动态表名称
大家好 我有一个可怕的数据库 我必须使用它 而 linq to sql 是我用来检索数据的选项 我试图通过根据用户选择输入不同的表名称来重用函数 但据我所知 无法修改 DataContext 查询中的 TEntity 或 Table 这是我
sql
linqtosql
Dynamic
IEnumerable
IEnumerable
如何在后台工作
我正在徘徊于更深入的功能IEnumerable
c
LINQ
OOP
interface
IEnumerable
在 C# 中将两个列表映射到字典中
给定两个 IEnumerables 同样大小 如何转换为 Dictionary 使用林克 IEnumerable
c
NET
LINQ
Dictionary
IEnumerable
如何将列表转换为可枚举
我的以下代码有问题 public IEnumerable
c
list
IEnumerable
casting
一次性返回所有可枚举的yield return;不循环
我有以下函数来获取卡的验证错误 我的问题涉及处理 GetErrors 两种方法具有相同的返回类型IEnumerable
c
IEnumerable
yield
yieldreturn
IEnumerable vs IReadonlyCollection vs ReadonlyCollection 用于公开列表成员
我花了好几个小时思考曝光名单成员的问题 在与我类似的问题中 乔恩 斯基特 Jon Skeet 给出了很好的答案 请随意看看 ReadOnlyCollection 或 IEnumerable 用于公开成员集合 https stackoverf
c
NET
list
IEnumerable
encapsulation
在 C# 中动态“解压缩”IEnumerable 或最佳替代方案
假设您有一个返回延迟枚举对象的函数 struct AnimalCount int Chickens int Goats IEnumerable
c
Algorithm
LINQ
IEnumerable
enumerator
Skip 的性能(以及类似功能,如 Take)
我刚刚看了一下源代码Skip Take NET Framework 的扩展方法 在IEnumerable
c
performance
LINQ
IEnumerable
skiptake
IEnumerable
是如何逆变的?
这个帖子 http blogs msdn com b brada archive 2005 01 18 355755 aspx https web archive org web 20140417104304 http blogs msdn
c
generics
IEnumerable
covariance
contravariance
队列上的 IEnumerable 迭代器是否应该使项目出列
我创建了一个自定义通用队列 它实现了通用 IQueue 接口 该接口使用 System Collections Generic 命名空间中的通用队列作为私有内部队列 示例已清除不相关的代码 public interface IQueue
c
NET
Iterator
Queue
IEnumerable
OrderBy Linq 的奇怪行为
我有一个使用以下命令排序的列表OrderBy Linq 函数 返回一个IOrderedEnumerable var testList myList OrderBy obj gt obj ParamName ParamName 是一个可以保存
c
LINQ
IEnumerable
iorderedenumerable
创建 IEnumerable
.Find()
我想写 IEnumerable
c
extensionmethods
IEnumerable
将 List
转换为 IEnumerable
我仍在学习一些 c 的东西 但我找不到这个问题的答案 假设我有一个实现 MyInterface 的 MyObject 列表 public class MyObject IMyInterface public List
c
list
casting
IEnumerable
AsQueryable() 的目的是什么?
目的是AsQueryable 只是为了让你可以传递一个IEnumerable到可能期望的方法IQueryable 或者有一个有用的理由来表示IEnumerable as IQueryable 例如 是否应该适用于这样的情况 IEnumera
c
NET
LINQ
IEnumerable
iqueryable
«
1
2
3
4
5
6
...9
»