/// <summary> /// Sets the validation errors for the specified property. /// </summary> /// <typeparam name="TProperty">The property type for which to set errors.</typeparam> /// <param name="propertyExpression">The <see cref="Expression"/> indicating the property.</param> /// <param name="propertyErrors">The list of errors to set for the property.</param> public void SetErrors <TProperty>(Expression <Func <TProperty> > propertyExpression, IEnumerable <T> propertyErrors) { var propertyName = PropertySupport.ExtractPropertyName(propertyExpression); SetErrors(propertyName, propertyErrors); }
/// <summary> /// Clears the errors for the property indicated by the property expression. /// </summary> /// <typeparam name="TProperty">The property type.</typeparam> /// <param name="propertyExpression">The expression indicating a property.</param> /// <example> /// container.ClearErrors(()=>SomeProperty); /// </example> public void ClearErrors <TProperty>(Expression <Func <TProperty> > propertyExpression) => ClearErrors(PropertySupport.ExtractPropertyName(propertyExpression));