کدام پروایدر MySQL با EF Core 3x سازگار است؟
نویسنده: وحید نصیری
تاریخ: ۱۳۹۹/۰۱/۱۱ ۱۰:۵۱
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
There are two MySQL providers for Entity Framework Core:
- The official one from MySQL: MySql.Data.EntityFrameworkCore. As of now, the latest version is 8.0.19, and works with Entity Framework Core 2.1 (and probably also 2.2). Since EF Core 3.0 is a major version with breaking changes, you cannot use it with this provider.
- The Pomelo provider: Pomelo.EntityFrameworkCore.MySql. There is a 3.1 version of this provider.
In other words, if you want to use EF Core 3.0/3.1 with MySQL, at this point you need to use the Pomelo provider (or wait for the official MySQL one to get released).
modelBuilder.Entity<User>().Property(p => p.NormalizedUserName).HasMaxLength(191); modelBuilder.Entity<User>().Property(p => p.Email).HasMaxLength(191); modelBuilder.Entity<User>().Property(p => p.NormalizedEmail).HasMaxLength(191); modelBuilder.Entity<UserLogin>().Property(p => p.LoginProvider).HasMaxLength(191); modelBuilder.Entity<UserLogin>().Property(p => p.ProviderKey).HasMaxLength(191); modelBuilder.Entity<UserToken>().Property(p => p.LoginProvider).HasMaxLength(191); modelBuilder.Entity<UserToken>().Property(p => p.Name).HasMaxLength(191);