C# 클래스 FluentValidation.WebApi.FluentValidationBodyModelValidator

Recursively validate an object. Is just a copy of the DefaultBodyModelValidator but includes a "patch" for the FluentValidationModelValidator When the whole model is validated the errors get added to the ModelState grouped by property instead of all under the model. It also changes the check of previous errors to avoid missing error messages when there are bind errors If the FluentValidationModelValidator is not used to validate, fallbacks to the DefaultBodyModelValidator behaviour Another difference is that the IModelValidatorCache had to be removed because it's internal to the asp net framework (affects performance but not the behaviour)
상속: IBodyModelValidator
파일 보기 프로젝트 열기: JeremySkinner/FluentValidation

공개 메소드들

메소드 설명
Validate ( object model, Type type, System.Web.Http.Metadata.ModelMetadataProvider metadataProvider, System.Web.Http.Controllers.HttpActionContext actionContext, string keyPrefix ) : bool

비공개 메소드들

메소드 설명
CreateIndexModelName ( string parentName, int index ) : string
CreateIndexModelName ( string parentName, string index ) : string
CreatePropertyModelName ( string prefix, string propertyName ) : string
GetElementType ( Type type ) : Type
IsSimpleType ( Type type ) : bool
ShallowValidate ( System.Web.Http.Metadata.ModelMetadata metadata, ValidationContext validationContext, object container ) : bool
ValidateElements ( IEnumerable model, ValidationContext validationContext ) : bool
ValidateNodeAndChildren ( System.Web.Http.Metadata.ModelMetadata metadata, ValidationContext validationContext, object container ) : bool
ValidateProperties ( System.Web.Http.Metadata.ModelMetadata metadata, ValidationContext validationContext ) : bool

메소드 상세

Validate() 공개 메소드

public Validate ( object model, Type type, System.Web.Http.Metadata.ModelMetadataProvider metadataProvider, System.Web.Http.Controllers.HttpActionContext actionContext, string keyPrefix ) : bool
model object
type System.Type
metadataProvider System.Web.Http.Metadata.ModelMetadataProvider
actionContext System.Web.Http.Controllers.HttpActionContext
keyPrefix string
리턴 bool