2

I come from a Powerbuilder background. I was recently announced that we change development platform: MVC 4 + Entity 4 + KendoUI

I am having difficulties and I am trying to get hold of the subject quickly.

I have a question. I built a quite large database (lot of tables) for the project I was assigned. I created the entities via Entity Framework 4.1.

Is there a way that I can create classes (.cs) from the entities automatically?

Having to create 170 classes (.cs) is a time consuming task and I prefer to spend my time learning.

Thanx in advance

PS Maybe the question is naive, but i have never worked with .NET C# etc

4

2 回答 2

3

如果您已经创建了数据库,请尝试使用数据库优先方法,它会自动将所有表映射到类中:

http://msdn.microsoft.com/en-us/data/gg702905.aspx

于 2012-12-27T20:08:29.963 回答
0

此处描述了标准的 4 个选项http://msdn.microsoft.com/en-us/data/ee712907 code first/modelling /existing database combination

EF Powertools nuget 包提供的一个额外选项是先从现有数据库进行逆向工程代码。我发现这非常有用。

于 2012-12-27T21:42:13.893 回答