PanosPlat
PanosPlat

Reputation: 958

MVC 4 create classes from entities

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

Upvotes: 2

Views: 1611

Answers (2)

phil soady
phil soady

Reputation: 11308

The standard 4 options are described here http://msdn.microsoft.com/en-us/data/ee712907 code first/modelling /existing database combinations

An extra option EF Powertools nuget package offers is reverse engineer code first from an existing database. I have found that to be quite useful.

Upvotes: 0

marcos.borunda
marcos.borunda

Reputation: 1486

If you already have your database created then try using the database first approach, it'll automatically map all your tables into classes:

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

Upvotes: 3

Related Questions