I have an ASP core MVC app and inside it a background task that run a query every 5 seconds, some things like this:
var dbContext = serviceProvider.GetRequiredService<ApplicationDbContext>();
var files = await dbContext.Set<File>().Where(...).ToListAsync();
The problem is it fills my output with this log:
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (1ms) ...
I know it's possible to change the global DB Context settings or log level to make ef log completely silent but I'm searching for a way to suppress log query of only this command or db context.