C# 클래스 MyTested.AspNetCore.Mvc.Utilities.Validators.ContentTypeValidator

Validator class containing content type validation logic.
파일 보기 프로젝트 열기: ivaylokenov/MyTested.AspNetCore.Mvc

공개 메소드들

메소드 설명
ValidateContainingOfContentType ( dynamic result, Microsoft.Net.Http.Headers.MediaTypeHeaderValue expectedContentType, Action failedValidationAction ) : void

Validates whether action result ContentTypes contains the provided content type from action result containing such property.

ValidateContentType ( dynamic result, string expectedContentType, Action failedValidationAction ) : void

Validates whether ContentType is the same as the provided one from action result containing such property.

ValidateContentType ( string expectedContentType, string actualContentType, Action failedValidationAction ) : void

Validates whether two content types are the same.

ValidateContentTypes ( dynamic result, IEnumerable contentTypes, Action failedValidationAction ) : void

Validates whether action result ContentTypes contains the provided content types from action result containing such property.

비공개 메소드들

메소드 설명
SortContentTypes ( IEnumerable contentTypes ) : IList
TryGetContentTypesCollection ( dynamic actionResult ) : IEnumerable

메소드 상세

ValidateContainingOfContentType() 공개 정적인 메소드

Validates whether action result ContentTypes contains the provided content type from action result containing such property.
public static ValidateContainingOfContentType ( dynamic result, Microsoft.Net.Http.Headers.MediaTypeHeaderValue expectedContentType, Action failedValidationAction ) : void
result dynamic Component result with ContentTypes.
expectedContentType Microsoft.Net.Http.Headers.MediaTypeHeaderValue Expected content type.
failedValidationAction Action Action to call in case of failed validation.
리턴 void

ValidateContentType() 공개 정적인 메소드

Validates whether ContentType is the same as the provided one from action result containing such property.
public static ValidateContentType ( dynamic result, string expectedContentType, Action failedValidationAction ) : void
result dynamic Component result with ContentType.
expectedContentType string Expected content type.
failedValidationAction Action Action to call in case of failed validation.
리턴 void

ValidateContentType() 공개 정적인 메소드

Validates whether two content types are the same.
public static ValidateContentType ( string expectedContentType, string actualContentType, Action failedValidationAction ) : void
expectedContentType string Expected content type.
actualContentType string Actual content type.
failedValidationAction Action Action to call in case of failed validation.
리턴 void

ValidateContentTypes() 공개 정적인 메소드

Validates whether action result ContentTypes contains the provided content types from action result containing such property.
public static ValidateContentTypes ( dynamic result, IEnumerable contentTypes, Action failedValidationAction ) : void
result dynamic Component result with ContentTypes.
contentTypes IEnumerable Expected content types.
failedValidationAction Action Action to call in case of failed validation.
리턴 void