DataContext 随机函数有时会失败
在我的 LINQ DataContext 类中,我有一个函数,用于按随机顺序对项目进行排序:
[Function(Name = "NEWID", IsComposable = true)]
public Guid Random()
{ // to prove not used by our C# code...
throw new NotImplementedException();
}
它在某些查询中可以正常工作(调用 NEWID 函数),但在某些查询中则不能(抛出 NotImplementedException)。为什么?
In my LINQ DataContext class I have a function which I use to sort items in a random order:
[Function(Name = "NEWID", IsComposable = true)]
public Guid Random()
{ // to prove not used by our C# code...
throw new NotImplementedException();
}
It works correctly in some queries (calls the NEWID function), but in some it doesn't (throws a NotImplementedException). Why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它附加到已在 SQL 服务器上编译并执行的 IQueryable,它可能会崩溃。
Probably it crashes if it is attached to an IQueryable that has already been compiled and executed on the SQL server.