I am about to get 6 random rows using EF Core (v5.0.4).
Here are columns in my table:
int id(primary key,auto increase)
varchar title
Most of the tutorials (like Picking random record from Entity Framework database without OrderBy) suggest using OrderBy(r => Guid.NewGuid())
Here is my code:
Context.topics.Where(//some logic).OrderBy(X => Guid.NewGuid()).Take(6);
However, in my project, this always returns the same rows without random results.
What's wrong with it? Thank you.