Entity Framework Core how to make Any Async?

Viewed 8746
    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.

1 Answers

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

Related