StringLength vs MaxLength attributes ASP.NET MVC with Entity Framework EF Code First

前端 未结 8 1657
情歌与酒
情歌与酒 2020-12-04 07:47

What is the difference in behavior of [MaxLength] and [StringLength] attributes?

As far as I can tell (with the exception that [MaxLe

8条回答
  •  粉色の甜心
    2020-12-04 08:15

    One another point to note down is in MaxLength attribute you can only provide max required range not a min required range. While in StringLength you can provide both.

提交回复
热议问题