Is there a way to set the length of a field in EF (6.1)?
I want the following property to be generated as char(2):
public string LanguageId { get; set; }
You could combine TypeName and StringLength:
[Column(TypeName = "char")]
[StringLength(2)]
public string LanguageId { get; set; }
Within SQL Server it should generate a char(2) column.
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