We do simple data entry validation with attributes on the viewmodel. Think format of an email address, mandatory clientname, format of a date, the housenumber being numeric etc.Now there are also more complex validations which will hit the database and external services: check if the id is a valid one (external service), see if the person (probably) already is present in the database based on name/address (database action), check the address/zip code combination (external service).In my opinion this logic should not be in the controller but in a separate validation component / validation service (which gets DI'd in the controller).I would like your opinion on this.
ASP.NET MVC: where to put data-entry logic which hits the database
mvc;asp.net mvc;validation