Data Annotation validation with dependency injection in a business service

What I love about data annotations and validation attributes, is that the validation rules are defined very close to the class: when you open it up, you can view all the rules. The ApiController will even automatically do model validation. This is great, but I like some defense in depth; I want to be able to use those validations in my business service as well. I should not have to trust input. Let’s explore how we can make that happen.

Read the article Data Annotation validation with dependency injection in a business service
expand_less brightness_auto