MVC3 Validation with Entity Framework Model/Database First

Viewed 9579

I want to use MVC 3 and the Entity Framework for my application.

The model will be stored in a different assembly to the MVC app.

The choice I'm making is either to use the EF to generate my entities or to use code first.

With code first, I can decorate members with [Required] etc... But how would I go about adding those attributes if EF has generated entities from the DB?

Having EF generate my entities will save a lot of time, but I want MVC to auto populate the validation depending on how I've decorated my members. Does this make sense? If so, how would I do that?

3 Answers
Related