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?
Using LINQ to SQL in LINQPad as C# statements look like
IEnumerable customers = this.ExecuteQuery(@"SELECT top 10 * from [Customers] order by newid()"); customers.Dump();
The generated SQL is
SELECT top 10 * from [Customers] order by newid()