色欲无边,绯闻少女第一季下载,zt3
原文链接:
maxlength特性指定了属性的值所允许的最大值,然后在数据库中就生成相应列的最大值。maxlength特性可以应用于实体的string类型的属性和byte[]数组类型的属性上。
如果maxlength特性,应用在其他类型的属性上就报错,例如下面的图中例子:
using system.componentmodel.dataannotations; public class student { public int studentid { get; set; } [maxlength(50)] public string studentname { get; set; } }
上面代码例子中,maxlength(50)应用在studentname属性上,指定studentname的属性值不能超过50个字符长度。
ef将会检查标识了maxlength特性的属性值,如果长度超过了指定的长度,就会报错,ef6报错:system.data.entity.validation.dbentityvalidationexception ,ef core报错:microsoft.entityframeworkcore.dbupdateexception.
请注意:maxlength特性, mvc中,用于验证属性的值,了解更多详情请看这篇文章: 。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论