예제 #1
0
 /// <summary>
 /// Adds an <see cref="ContentPropertyValidationResult"/> error to model state for a property so we can use it on the client side.
 /// </summary>
 /// <param name="modelState"></param>
 /// <param name="result"></param>
 /// <param name="propertyAlias"></param>
 /// <param name="culture">The culture for the property, if the property is invariant than this is empty</param>
 internal static void AddPropertyError(this ModelStateDictionary modelState,
                                       ValidationResult result, string propertyAlias, string culture = "", string segment = "") =>
 modelState.AddPropertyValidationError(new ContentPropertyValidationResult(result, culture, segment), propertyAlias, culture, segment);