C# Class FluentValidation.AspNetCore.ValidationResultExtension

显示文件 Open project: JeremySkinner/FluentValidation

Public Methods

Method Description
AddToModelState ( this result, ModelStateDictionary modelState, string prefix ) : void

Stores the errors in a ValidationResult object to the specified modelstate dictionary.

Method Details

AddToModelState() public static method

Stores the errors in a ValidationResult object to the specified modelstate dictionary.
public static AddToModelState ( this result, ModelStateDictionary modelState, string prefix ) : void
result this The validation result to store
modelState ModelStateDictionary The ModelStateDictionary to store the errors in.
prefix string An optional prefix. If ommitted, the property names will be the keys. If specified, the prefix will be concatenatd to the property name with a period. Eg "user.Name"
return void