数据注释属性未在EF7中应用 [英] DataAnnotation Atributes not applied in EF7
本文介绍了数据注释属性未在EF7中应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用k ef migration迁移数据库时,请添加bla bla。命令数据注释属性不反映到创建的数据库中
When i migrate a database using k ef migration add bla bla. command the data annotation attributes are not reflected to the created database
例如iam使用[MaxLength(2)]属性,并获得创建的数据类型为nvarchar(MAX)的列
e.g. iam using the [MaxLength(2)] attribute and am getting a column with data type nvarchar(MAX) created
请帮助
推荐答案
数据注释尚未在EF7中实现。参见问题#107 。
Data Annotations are not yet implemented in EF7. See issue #107.
这篇关于数据注释属性未在EF7中应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文