How can I create a field that is TEXT instead of NVARCHAR? Right now I've got
public string Text { get; set; }
But that always becomes a nvarchar column, I need a Text column
You can use System.ComponentModel.DataAnnotations.Schema.ColumnAttribute
[Column(TypeName = "text")]
public string Text { get; set; }
or via Fluent API:
modelBuilder.Entity<YourEntityTypeHere>()
.Property( e => e.Text)
.HasColumnType( "text" );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With