I have a group of "percentage" properties in my view model. As a simple example:
Is there an elegant way to do this within the confines of the FluentValidation framework?
public class ViewModel
{
public int Percent1 { get; set; }
public int Percent2 { get; set; }
public int Percent3 { get; set; }
public int Percent4 { get; set; }
}
I need to write a validation rule that ensures the total of these four properties equals 100. From what I've read, fluent validation requires that a rule be applied to an individual property rather than across multiple properties.Is there an elegant way to do this within the confines of the FluentValidation framework?