Untitled
Anonymous
plain_text
09/29/2023 6:57 PM
720 B
13
Indexable
public async Task<IEnumerable<Vaciadototal>> GetLastPeriod(string clientId, int count)
{
var query = from v in _context.Vaciadototals
where v.Numcliente.Trim() == clientId
group v by v.Numcliente into g
select new
{
ClientId = g.Key,
LastPeriods = g.OrderByDescending(k => k.Periodo).Take(count)
};
var results = await query.SelectMany(g => g.LastPeriods).ToListAsync();
return results;
}
Editor is loading...