Until now I've been using EF6 with Visual Studio, mostly code first, rarely database first.
To import some test data, someone gave me the connection to a database in MySQL. In MySql Workbench I can query data, so the connection works.
Now I want to create an Entity Framework Database First project and import the database model. In Visual Studio
- Create Project,
- Add nuget: Entity Framework newest version (6.1.3)
- Add nuget: MySql.Data.entities for EF 6
- Add new item
And now? There is an EF 6.X DbContext
generator, but that one does not work until I've got the model
I can do what I normally do:
- select ADO.NET entity data model
- EF Designer from database
- And now? How to connect to MySql?
Addition
Mehmet referred me to MySql EF6 Support (thanks Mehmet), a page that came first when I googled. Maybe this is the correct way, but I don't understand whtat it says The first steps: add the connection string and add the reference (= install nuget package?) I can manage, but after that it's all Greek to me:
- Set the new DbConfiguration class for MySql. THE new
DbConfiguration
class? WhichDbConfiguration
class? Where, and how to set it for MySQL? - Add the
DbConfigurationTypeAttribute
to theDbContext
. Alas, I haven't got aDbContext
yet, it's not code first, but database first: some wizard is supposed to determine theDbSets
in theDbContext
for me.
So maybe this is the way to go, but this is too cryptical for me.