TagSetSqlGenerator

No MigrationSqlGenerator found for provider ‘MySql.Data.MySqlClient’.

N

No MigrationSqlGenerator found for provider ‘MySql.Data.MySqlClient’. Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators.

Entity Framework Code First ile birlikte MySQL veritabanı kullanmak istediğimde yukarıdaki hata ile karşılaştım. Kısaca diyor ki Microsoft SQL Server dışında bir veritabanıyla çalışacaksan Sql Generator’ını eklemen gerekiyor.

Migration işlemimi yaptığım Configuration.cs içerindeki constructor‘a aşağıdaki kodu eklemem yeterli oldu.

[csharp]SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());[/csharp]

mysql_migration_entity_framework

Entity Framework ile MySQL kullanmak MSSQL’e göre veya  Ado.Net ile MySQL’e bağlanmaya göre biraz daha karmaşık. Maalesef Türkçe kaynak yok denecek kadar az, bununla ilgili Türkçe bir makale yazsam iyi olacak gibi :)

Get in touch

Quickly communicate covalent niche markets for maintainable sources. Collaboratively harness resource sucking experiences whereas cost effective meta-services.