Untitled
unknown
plain_text
2 years ago
538 B
6
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...