Is it possible to have a EF Context for MySql and SqlServer?

前端 未结 2 684
悲&欢浪女
悲&欢浪女 2021-01-24 06:30

I have two entity framework contexts, one for MySql and one for sql. If I run the app I get the following error

The default DbConfiguration instance was used by          


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-24 07:28

    FYIW - I had the same problem. The only thing that resolved the issue was to add the following code at the beginning of my program's execution.

    var needsToBeInstantiated = new EFDBContextConfiguration();
    EFDBContextConfiguration.SetConfiguration( needsToBeInstantiated );
    

提交回复
热议问题