Reputation: 5978
I have a product class, for which the ManufacturerNumber gets generated as nvarchar(max) - how would I go about forcing the code-first framework to make it nvarchar(255)
public class Product : BaseEntity
{
public string ManufacturerNumber { get; set; }
}
Upvotes: 0
Views: 242
Reputation: 32447
Decorate the property with StringLength
attribute.
public class Product : BaseEntity
{
[StringLength(255)]
public string ManufacturerNumber { get; set; }
}
Upvotes: 1