Migrating from Entity Framework 6 Code First MSSQL to MySQL

entity-framework entity-framework-6 mysql sql-server

Accepted Answer

I was able to resolve my issue by making two modifications.

  1. I made the following declaration on my HudHomeContext Class: [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguâ€â€ration))]

  2. In my base declaration, I included the connection string.

Thus, it now appears as follows:

 [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfigu‌​ration))]
public class MyContext : DbContext
{
    public MyContext() : base("server=mysql-portal.blahblah.us-blah-1.rds.amazonaws.com;port=3306;database=blahblah;uid=myusername;password=MYPASSWORD")
    {
        Database.SetInitializer<MyContext>(new MyDbInitializer());
    }
1
5/15/2017 4:29:52 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow