Jan 08, 2010 11:12 PM|insomniak54|LINK
I'm using an MVC project like that :
- Web MVC2 project : Presentation layer
- BLL Project : Services project with validation logic (I transmit the modelstate to the service layer and update it when i encouter business logic errors)
- DAL Project : Data Layer using Nhibernate
- DTO project : my business POCO
The method I use :
I create strongly typed forms. Actions has strongly typed parameters and call Business Layer Services.
The validation is done within Service Layer : When I call Insert or Update method, I call a validate function that updates modelstate (via a modelstatewrapper). Si it's quite normal usage (i think).
But I think the problem isn't on which method i use because when I call the action, modelstate is already set with an error from MVC framework which is english string.
So if I add a break point just onto the action definition I can see the validation error.
I hope it will help you, but if you want code, which one do you want to see ?