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