How to configure part of the model of my MVC application to point to my Linq to SQL project through my BLL?
Usually a repository template is used for this. The controller has a link to your repository - the repository returns your domain objects from your database. The MVC application does not know if LINQ to SQL exists.
How to check web applications? Can I use MVC 2.0 model validation? If not what alternatives?
Put view models in the MVC project. These review models may be closely aligned with your domain models, but their problem should be the presentation model. Put your data annotations to check on these view models - the MVC framework will automatically provide validation on these view models decorated with data annotations. It connects, so you can use alternatives, but with MVC 2 it baked quite well, and this includes client-side validation.
Finally (and a little to the side) - What is the ViewModel and how is it different from the model?
I partially answered this above. the shape of your domain models may not be the way you need it to reflect your views. Viewing models are great for bridging this gap. Also, even if the form exactly matches the view model, itβs still a good idea, so you can put the UI verification code and other presentation metadata there (since you donβt want something to be related to the presentation logic in your domain model) .
Here is a link to view model models .
Hope this helps.
source share