Class ErrorResponse
the dto used to send an error response to the client
Inheritance
System.Object
ErrorResponse
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public sealed class ErrorResponse
Constructors
ErrorResponse()
instantiate a new error response without any errors
Declaration
public ErrorResponse()
ErrorResponse(List<ValidationFailure>, Int32)
instantiate an error response with the given collection validation failures
Declaration
public ErrorResponse(List<ValidationFailure> failures, int statusCode = 400)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<FluentValidation.Results.ValidationFailure> | failures | |
System.Int32 | statusCode |
Properties
Errors
the collection of errors for the current context
Declaration
public Dictionary<string, List<string>> Errors { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.String>> |
Message
the message for the error response
Declaration
public string Message { get; set; }
Property Value
Type | Description |
---|---|
System.String |
StatusCode
the http status code sent to the client. default is 400.
Declaration
public int StatusCode { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |