1

I am new to ASPNET MVC and I'm trying to understand which is the best way to work with it; I have a DB structure and I'm using EF4 that generates the DbModel.edmx.

I could invoke Entities directly from the Controller but I've read somewhere that it could be better to embed all DB calls to a Repository Class and consume it from Controllers. Is it the right way to work in ASPNET MVC3?

How can DataValidation be handled with this structure?

1
  • 1
    ...better to embed all DB calls to a Repository Class and consume it from Controllers That's the best practice. Commented Jul 26, 2011 at 8:09

1 Answer 1

2

You may want to check NerdDinner which is done by high profile programmers and there is a step-by-step book as well. It also uses patterns such as Repository, ViewModel, DataValidation, etc.

Source code: http://nerddinner.codeplex.com/
Free book: http://www.wrox.com/WileyCDA/Section/id-321793.html

There is a branch for ASP.Net MVC 3 in the source code of NerdDinner. :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.