4
I would like to translate the following SQL statement to an expression lambda:
SELECT TOP 1 * FROM tbPessoa order by NEWID()
What do I put in OrderBy
that will be accepted?
var pessoa = contexto.tbPessoa.OrderBy(???).FirstOrDefault()
Note: the table has more than 3000 records, so ideally this should not be done in memory.
It worked. I thought it would be very complicated, and if I had something, it would have to be in memory. I was surprised by the simple solution.
– user26552