C# Класс Unosquare.PassCore.Web.Models.ApiResult

Represent a generic response from a REST API call
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddFieldMismatchValidationError ( string fieldName ) : void

Adds the field mismatch validation error.

AddFieldRequiredValidationError ( string fieldName ) : void

Adds the field required validation error.

AddGenericFieldValidationError ( string fieldName, string message ) : void

Adds the generic field validation error.

AddModelStateErrors ( ModelStateDictionary modelState ) : void

Adds the model state errors.

AddOperationError ( ApiErrorCode errorCode, string message ) : void

Adds the operation error.

AddValidationError ( string fieldName, ApiErrorCode errorCode ) : void

Adds the validation error.

InvalidRequest ( ) : ApiResult

Creates a generic invalid request response

Success ( ) : ApiResult

Creates a generic success response

Описание методов

AddFieldMismatchValidationError() публичный Метод

Adds the field mismatch validation error.
public AddFieldMismatchValidationError ( string fieldName ) : void
fieldName string Name of the field.
Результат void

AddFieldRequiredValidationError() публичный Метод

Adds the field required validation error.
public AddFieldRequiredValidationError ( string fieldName ) : void
fieldName string Name of the field.
Результат void

AddGenericFieldValidationError() публичный Метод

Adds the generic field validation error.
public AddGenericFieldValidationError ( string fieldName, string message ) : void
fieldName string Name of the field.
message string The message.
Результат void

AddModelStateErrors() публичный Метод

Adds the model state errors.
public AddModelStateErrors ( ModelStateDictionary modelState ) : void
modelState ModelStateDictionary State of the model.
Результат void

AddOperationError() публичный Метод

Adds the operation error.
public AddOperationError ( ApiErrorCode errorCode, string message ) : void
errorCode ApiErrorCode The error code.
message string The message.
Результат void

AddValidationError() публичный Метод

Adds the validation error.
public AddValidationError ( string fieldName, ApiErrorCode errorCode ) : void
fieldName string Name of the field.
errorCode ApiErrorCode The error code.
Результат void

InvalidRequest() публичный статический Метод

Creates a generic invalid request response
public static InvalidRequest ( ) : ApiResult
Результат ApiResult

Success() публичный статический Метод

Creates a generic success response
public static Success ( ) : ApiResult
Результат ApiResult