C# Class Unosquare.PassCore.Web.Models.ApiResult

Represent a generic response from a REST API call
Datei anzeigen Open project: unosquare/passcore Class Usage Examples

Public Methods

Method Description
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

Method Details

AddFieldMismatchValidationError() public method

Adds the field mismatch validation error.
public AddFieldMismatchValidationError ( string fieldName ) : void
fieldName string Name of the field.
return void

AddFieldRequiredValidationError() public method

Adds the field required validation error.
public AddFieldRequiredValidationError ( string fieldName ) : void
fieldName string Name of the field.
return void

AddGenericFieldValidationError() public method

Adds the generic field validation error.
public AddGenericFieldValidationError ( string fieldName, string message ) : void
fieldName string Name of the field.
message string The message.
return void

AddModelStateErrors() public method

Adds the model state errors.
public AddModelStateErrors ( ModelStateDictionary modelState ) : void
modelState ModelStateDictionary State of the model.
return void

AddOperationError() public method

Adds the operation error.
public AddOperationError ( ApiErrorCode errorCode, string message ) : void
errorCode ApiErrorCode The error code.
message string The message.
return void

AddValidationError() public method

Adds the validation error.
public AddValidationError ( string fieldName, ApiErrorCode errorCode ) : void
fieldName string Name of the field.
errorCode ApiErrorCode The error code.
return void

InvalidRequest() public static method

Creates a generic invalid request response
public static InvalidRequest ( ) : ApiResult
return ApiResult

Success() public static method

Creates a generic success response
public static Success ( ) : ApiResult
return ApiResult