EF Code First: How to get random rows

Just call:

something.OrderBy(r => Guid.NewGuid()).Take(5)

Leave a Comment