I try to get random record from database:
personToCall = db.Persons.Skip(toSkip).Take(1).First();
but I get exception which tells me:
{"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'."}
Can I do it without OrderBy
? Sorting data structure (O(nlogn)) to pick random element(which should be constant) doesn't look wise.
EDIT: I use Entity Framework 6.1.1.