In EFCore 2.0 Add new feature, DbContext pooling. i know how to use it in single context, however, sometimes need multi context in project,
public class BContext
Or you can register your own factory of DbContextPool
services.AddDbContextPool(options =>
{
options.UseInMemoryDatabase("AContext.InMemory");
});
services.AddDbContextPool(options =>
{
options.UseInMemoryDatabase("BContext.InMemory");
});
collection.AddSingleton(svcs => new DbContextPool(svcs.GetService>()));
collection.AddSingleton(svcs => new DbContextPool(svcs.GetService>()));