I need to search the last 100 records of the bank, I am using the following code, but it returns the first 100:
dynamic data = null;
try
{
data = limit == 0 ?
(from p in contexto.Set<TEntity>() select p).Where(predicate).ToList() :
(from p in contexto.Set<TEntity>() select p).Where(predicate).ToList().Take(limit);
}
I tried to put the .Last (), but gave an error:
How can I resolve this?