Last active
August 18, 2017 08:04
-
-
Save merken/da46aeaf0ef79938f152af867cc3d9a2 to your computer and use it in GitHub Desktop.
Entity Framework Core: Data type 'nvarchar' is not supported in this form. Either specify the length explicitly in the type name, for example as 'nvarchar(16)', or remove the data type and use APIs such as HasMaxLength to allow EF choose the data type.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyDbContext : MyContext | |
{ | |
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
base.OnModelCreating(modelBuilder); | |
modelBuilder.Entity<MyEntity>(entity => | |
{ | |
entity.Property(e => e.MyProperty) | |
.HasColumnType("nvarchar(4000)"); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment