Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Exclude validation in complex model

$
0
0
Hi, everyone.
Is there a way to exclude validation of child objects, if I want to validate only parent in code like this:
[Validator(CustomerValidator)]
class Customer { ... }

[Validator(CustomerViewModelValidator)]
class CustomerViewModel { 
  public Customer { get; set; }
  
  //Some other data 
 ... 
}
In case when I need to validate only CustomerViewModel how can i disable validation of Customer with CustomerValidator and validate only CustomerViewModel with CustomerViewModelValidator?

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>