The randomization in a LINQ query cannot be propagated to the database server with OpenAccess. However, if you retrieve the persistent objects in memory, you can benefit from the LINQ to Objects implementation. You can then order your items by a random number generated with the Random class.
(NorthwindContext context =
Random random =
var query = context.Categories;
var orderedQuery = query.ToList().OrderBy(x => random.Next());
There is another option which is situationally useful – you can create a view which performs the ordering on the database server side and map it to a persistent type. Each time you retrieve a collection of persistent objects from this view, you will get them in a random order unless you order them explicitly.
I hope this helps. Do not hesitate to contact us if you have more questions.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items