Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Classes for EF - newbie question
Message
 
 
À
06/12/2015 14:32:29
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01628544
Message ID:
01628566
Vues:
37
>> I suggest you to look at Reverse POCO generator by Simon Hudges https://efreversepoco.codeplex.com/ We're using it in our current project. Every time you make changes in your database, you simply run the tool to re-generate the classes. In our application we have 2 projects. One is the Data project that contains configurations for each table/view, the other is Models which contains a single class file for each table/view. That project is quite flexible and allows you to generate all you need.
>
>But the problem is the same as in the EF Designer - when the classes are re-generated it can break a whole lot of code that used those classes.......

In our case there is a minimum risk. The main table structure is usually pretty stable, extra new columns or removing a few columns or adjusting length of the existing columns are not drastic changes and so all necessary code updates are limited and can be applied quickly. So far we didn't find any problems with that class or using our approach.

One important thing to keep in mind, though - when the Models are changed, we need to bring necessary changes to ViewModels manually if these classes are already generated.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform