开发者

DataContext random function sometimes fails

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();
 开发者_如何学C   }

It works correctly in some queries (calls the NEWID function), but in some it doesn't (throws a NotImplementedException). Why?


Probably it crashes if it is attached to an IQueryable that has already been compiled and executed on the SQL server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜