What is the best practice in EF Core for using parallel async calls with an Injected DbContext?
I have a .NET Core 1.1 API with EF Core 1.1 and using Microsoft's vanilla setup of using Dependency Injection to provide the DbContext to my services. (Reference: https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/intro#register-the-context-with-dependency-injection ) Now, I am looking into parallelizing database reads as an optimization using WhenAll So instead of: var result1 = await _dbContext.TableModel1.FirstOrDefaultAsync(x => x.SomeId == AnId); var result2 = await _dbContext.TableModel2.FirstOrDefaultAsync(x => x.SomeOtherProp == AProp); I use: var repositoryTask1 = _dbContext