I found this handy query;
SELECT TOP 1 * FROM Advertising ORDER BY NEWID()
but need to turn it into a LINQ query.
I tried doing something like;
var a = (from record in Advertising
select record)
but can’t figure out how to do the ordering so that a random record is returned.
It is probably easiest to just execute the command directly.
You could also do it with an sproc, or if you want a totally generic way to do it you can query the count, then generate a random number in that range and skip. (As others have noted while I was typing this)