I'm trying to validate that the hours are equal by comparing Projects hours and TimeEntry hours where dateworked are same date.
publicclass TimeSheet {public TimeEntry MondayTime { get; set;}public List<Project> Projects {get;set;} }publicclass TimeEntry {publicdouble Hours {get;set;}public DateTime DateWorked {get;set;} }publicclass Project {publicdouble Hours {get;set;}public DateTime DateWorked {get;set;}publicstring Name {get;set;} }// validatorpublicclass TimeSheetValidator : AbstractValidator<TimeSheet> {public TimeSheetValidator() { RuleFor(x => x.MondayTimeEntry).Must((timeSheet, timeEntry) => timeSheet.Projects.All(p=>p.DateWorked == timeEntry.DateWorked));
// stuck here how to sum project hours and validate that they are equal to timeentry hours?
}