protected virtual ValidatorResult ValidateItem(JObject item) { ValidatorResult toReturn = new ValidatorResult() { IsValid = true, Messages = new List <string>() }; if (item != null && this.PayloadItemPropertyValidators != null && this.PayloadItemPropertyValidators.Any()) { this.PayloadItemPropertyValidators.ForEach(v => toReturn.Concat(v.Validate(item))); } return(toReturn); }
public override ValidatorResult Validate(JObject payload) { ValidatorResult toReturn = new ValidatorResult() { IsValid = true, Messages = new List <string>() }; if (payload != null) { JArray collection = payload.Property(this.PropertyName, StringComparison.InvariantCultureIgnoreCase)?.Value as JArray; if (collection != null && collection.Any()) { collection.ForEach(i => toReturn.Concat(this.ValidateItem(i as JObject))); } } return(toReturn); }