摘要: 1、实体类Attribute:需要引用命名空间System.ComponentModel.DataAnnotations[Required(ErrorMessage="")]:表示字段必须,在提交时进行验证,不通过返回ErrorMessage。[DisplayFormat(NullDisplayText="",DataFormatString="")]:用于日期显示格式及对于NULL值的处理。[Key]:主键字段。[MaxLength(36,ErrorMessage="")]:最大长度限制,超出限制时返回Error 阅读全文
posted @ 2013-01-07 15:59 禁止吸烟 阅读(5023) 评论(12) 推荐(1) 编辑