How to get random row in linqtosql?

Create a view in SQL server for take a random record

The view is required because it’s not possible to directly use NEWID in a scalar function. You can then map the GetNewId user-defined function using LINQ to SQL’s Function attribute. Again, see chapter 8 for the details. That’s it! You can now write LINQ queries as usual. Here is an example to pick a random object:

then use you linq query like this

I hope it will definitely helpful to you….