且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MVC3验证与实体框架模型/数据库优先

更新时间:2021-07-02 07:25:47

在这种情况下,MetadataTypeAttribute用来。您可以使用部分类结合起来,以达到预期的效果。

In that case, MetadataTypeAttribute is used. You can combine it with partial classes to achieve desired results

顺便说一下,在你的地方,我会使用数据库优先和code首先设计之间作出决定时,做更多的研究。这一切是不是生成实体时节省时间,有这两种方法之间的更差。为了节省时间的目的,你可以使用 EF电动工具来生成数据库code第一实体 - 简单的

And by the way, in your place i would do more research when deciding between using Database First and Code First designs. That all is not about saving time when generating entities, there's much more difference between those two approaches. For the time saving purpose, you can use EF Power Tools to generate code first entities from database - simple.