I have a
1) text field type in my Sql server that I would like to map it to Entity framework 4.1 Code First. How can I do that?
2) When you declare a string variable in POCO classes, it maps to nvarchar in Sql Server. How it map it to varchar? I am pretty sure my data will always be English and not multilingual.
Thanks in advance :)
Use this:
public class Foo
{
[Column(TypeName = "ntext")]
[MaxLength]
public string TextProp {get; set;}
}
This should create ntext column in Sql Server and not nvarchar.
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