I am trying to generate longtext type database column using an Entity Framework code-first approach. I already used Column(TypeName = "longtext") data annotation but I am getting error
Column, parameter, or variable #3: Cannot find data type LONGTEXT.
My code:
public class MyText
{
[Key]
public int Id { get; set; }
[Column(TypeName = "longtext")]
public string Txt { get; set; }
}
Any idea how I can generate a longtext column then?
here you go - pretty straight forward...
public class MyText
{
[Key]
public int Id { get; set; }
//leaving this blank it will give you nvarchar(MAX)
public string Txt { get; set; }
}
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