Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Database First Import
Message
De
16/01/2013 15:45:02
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:
01563025
Vues:
44
>>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 :-)
>

Yes, this is a small and simple internal app and my first foray into MVC. The scaffolding helped me get off the ground. I don't expect a lot of changes.

>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.
>

Thanks, I'll check that out.

>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.
>

Regardless of where you start, you end up with all three (database, model, code) right? Or is that only because I'm using the scaffolding?

By the way, do you like to use EF for MVC projects, or do you prefer something else? Also, where do you put your business logic? I'm talking code beyond simple validations. MVC Scaffolding implements a "repository" layer, but I haven't looked into what that really means.

Thanks.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform