我该如何创建一个TEXT类型的字段而不是NVARCHAR类型的字段?目前我的代码是这样的:
public string Text { get; set; }
但它总是成为一个nvarchar列,我需要一个Text列
我该如何创建一个TEXT类型的字段而不是NVARCHAR类型的字段?目前我的代码是这样的:
public string Text { get; set; }
但它总是成为一个nvarchar列,我需要一个Text列
System.ComponentModel.DataAnnotations.Schema.ColumnAttribute
。[Column(TypeName = "text")]
public string Text { get; set; }
或通过流畅的API:
modelBuilder.Entity<YourEntityTypeHere>()
.Property( e => e.Text)
.HasColumnType( "text" );