Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Database First Import
Message
 
À
10/01/2013 16:32:50
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 5.0
Database:
MS SQL Server
Divers
Thread ID:
01562068
Message ID:
01562361
Vues:
55
>I'm getting my feet wet with ASP.NET MVC. I'm using MVC4, VS2012, and MVC Scaffolding. I pulled in an existing database using the provided wizard. The generated model does not include annotations like [MaxLength] or [Required]. Did I miss something or is that not a feature of the wizard? Seems like a pretty big missing feature if you ask me. Without it, I have to enter all the annotations manually if I want MVC to do the validations.

The Scaffolding is a down and dirty one way tool - I wouldn't recommend that for anything but a down and dirty protype environment :-)

For the data import features - you might try the EF Code First Power Tools. It includes an db import wizard as well (not sure if it's the same one or not) and it might do a better job of picking up database features.

As the name suggests: Code First is meant as a coding tool and not a Wizard interface. The other Entitity Framework modes - Database First and Model First are better aimed to deal with complete database imports than Code First which is meant as a coded approach to generating a database from the model.

+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform