how to use multi DBContextPool?

前端 未结 2 1402
自闭症患者
自闭症患者 2021-01-21 06:05

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         


        
2条回答
  •  一个人的身影
    2021-01-21 06:30

    Ok. i've found problem. You need to download EF Core, then change constructor for DbContextPool< TContext>

    original

    public DbContextPool([NotNull] DbContextOptions options)
    

    and change to

    public DbContextPool([NotNull] DbContextOptions options)
    

    otherwise DI will use last added options :)

提交回复
热议问题