What is the best (and fastest) way to retrieve a random row using Linq to SQL when I have a condition, e.g. some field must be true?
If you use LINQPad, switch to C# program mode and do this way:
void Main() { YourTable.OrderBy(v => Random()).FirstOrDefault.Dump(); } [Function(Name = "NEWID", IsComposable = true)] public Guid Random() { throw new NotImplementedException(); }