How do I specify that a property should generate a TEXT column rather than an nvarchar(4000)

I appreciate the effort that went into the existing answer, but I haven’t found it actually answering the question… so I tested this, and found out that

[Column(TypeName = "ntext")]
public string Body { get; set; }

(the one from System.ComponentModel.DataAnnotations) will work to create an ntext type column.

(My problem with the accepted answer is that it seems to indicate that you should change the column type in the interface, but the question is how to do it programmatically.)

Leave a Comment