我试图为EF7添加MySQL连接器/网络提供程序:使用以下方式之一。但System.Data.Entity
在EF7中没有DbConfiguration
类。这个类是否被移动了,或者我是否需要做一些不同的事情来添加MySQl提供程序?
1)在context类上添加DbConfigurationTypeAttribute
:
[DbConfigurationType(typeof(MySqlEFConfiguration))]
或
2)调用
DbConfiguration.SetConfiguration(new MySqlEFConfiguration())
EF 7将使用与EF 6不同的配置模式。有关配置DbContext的详细示例,请查看我们的Wiki页面。
https://github.com/aspnet/EntityFramework/wiki/Configuring-a-DbContext也是, EF 7的MySQL提供程序还不可用。