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

PanosPlat
  • 940
  • 1
  • 11
  • 29
  • 1
    Do you have an edmx model defined? Follow this post: http://stackoverflow.com/questions/10126871/entity-framework-generating-classes – Davin Tryon Dec 27 '12 at 20:03

2 Answers2

3

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

marcos.borunda
  • 1,486
  • 1
  • 17
  • 34
0

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.

phil soady
  • 11,043
  • 5
  • 50
  • 95