How do I set a column in SQL Server to varchar(max) using ASP.net EF Codefirst Data Annotations?

前端 未结 5 883
南笙
南笙 2021-02-06 20:31

I\'ve been searching around the web trying to figure out the right syntax to have Entity Framework Code First create my table with a column: varchar(max).

This is what I

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-06 21:15

    Use [MaxLength] annotation.

    [Column(TypeName = "varchar")]
    [MaxLength]
    public string MediaDesc { get; set; }
    

提交回复
热议问题