.Net Core 2.0 Database First Approach Scaffold-DbContext of Mysql DB

ぐ巨炮叔叔 提交于 2019-11-30 19:30:31

After digging i found that .Net Core 2.0 Mysql Connector is not working properly and after some search and RnD i found Pomelo Foundation from Stack overflow i tried it and it works.

Taking a look at the official sourcecode for the MySQL Connector for .Net, you can see that it's not complete yet due to this:

public DatabaseModel Create(string connectionString, 
    IEnumerable<string> tables, IEnumerable<string> schemas)
{
  throw new NotImplementedException();
}

You may want to open up a bug report on the official bug tracker.

Alternatively, there does seem to be a much newer beta version that you could look at trying. https://www.nuget.org/packages/MySql.Data.EntityFrameworkCore/8.0.9-dmr

M. Artem

You should run this (from Package-Manager-Console):

Scaffold-DbContext "Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;" 
MySql.Data.EntityFrameworkCore -OutputDir Models

or use:

dotnet ef dbcontext scaffold

Note: You should be at the project in which MySql.Data.EntityFrameworkCore NuGet package has been added.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!