public async Task<bool> IsParagemOnGoingAsync(int registoId)
{
return await _context.ParagensRegistos
.Where(pr => pr.RegistoId == registoId)
.Any(pr => pr.HoraFim == null);
}
how can i make this async? I can't find anythig on google...
EDIT
I knew about AnyAsync();
I tried like multiple times and never had intellisense to add the reference.
You can use AnyAsync()
public async Task<bool> IsParagemOnGoingAsync(int registoId)
{
return await _context.ParagensRegistos
.Where(pr => pr.RegistoId == registoId)
.AnyAsync(pr => pr.HoraFim == null);
}
More info on AnyAsync()
here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With