在网格中,我需要通过其ID来寻呼记录.这就是为什么我需要在用户过滤和用户排序的集合中找到它的索引.
我正在使用LINQ to Entities.查询是基于用户输入动态构建的.
该表包含太多(超过10 ^ 5)条记录,因为以下Stack Overflow建议是有益的:
Recs = Recs.Where( /* Filters */ );
Recs = Recs.OrderBy( /* Sort criteria */ );
Recs.AsEnumerable()
.Select((x,index) => new {RowNumber = index, Record = x})
.Where(x=>x.Record.ID = 35);
Run Code Online (Sandbox Code Playgroud)
由于LINQ to Entities不支持Select((entity, index) => ...),因此需要从SQL服务器下载250,000条记录,因此我可以决定显示第25,000页.
目前,我最有希望的想法是将每个排序标准转换为过滤器.因此,找到按升序高度排序的人的索引将计入较短的人(排序标准'高度上升'=>过滤器'高度小于'+计数).
我该怎么做呢?这个问题已经解决了吗?有没有.NET的图书馆,甚至我的一半?
我正在为CIL编写一个静态分析工具.如果finally块可以被解释为在catch中具有重新抛出的try-catch块,则将简化控制流分析.在C#中,我看不出它们之间的区别
try
{
// ...
}
finally
{
// finally code here
}
Run Code Online (Sandbox Code Playgroud)
和
try
{
// ...
}
catch
{
// finally code here
throw;
}
Run Code Online (Sandbox Code Playgroud)
或之间
try
{
// ...
}
catch(Exception e)
{
// catch code here
}
finally
{
// finally code here
}
Run Code Online (Sandbox Code Playgroud)
和
try
{
try
{
// ...
}
catch (Exception e)
{
// catch code here
}
}
catch
{
// finally code here
throw;
}
Run Code Online (Sandbox Code Playgroud)
在CIL中甚至有一个最终的块和最终指令.必须有区别,有吗?