Class BadRequestErrorMessageResult
Represents an action result that returns BadRequest response and performs content negotiation on an see HttpError with Message.
public class BadRequestErrorMessageResult : IHttpActionResult
- Inheritance
-
BadRequestErrorMessageResult
- Implements
- Inherited Members
Constructors
BadRequestErrorMessageResult(string, IContentNegotiator, HttpRequestMessage, IEnumerable<MediaTypeFormatter>)
Initializes a new instance of the BadRequestErrorMessageResult class.
public BadRequestErrorMessageResult(string message, IContentNegotiator contentNegotiator, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters)
Parameters
message
stringThe user-visible error message.
contentNegotiator
IContentNegotiatorThe content negotiator to handle content negotiation.
request
HttpRequestMessageThe request message which led to this result.
formatters
IEnumerable<MediaTypeFormatter>The formatters to use to negotiate and format the content.
BadRequestErrorMessageResult(string, ApiController)
Initializes a new instance of the BadRequestErrorMessageResult class.
public BadRequestErrorMessageResult(string message, ApiController controller)
Parameters
message
stringThe user-visible error message.
controller
ApiControllerThe controller from which to obtain the dependencies needed for execution.
Properties
ContentNegotiator
Gets the content negotiator to handle content negotiation.
public IContentNegotiator ContentNegotiator { get; }
Property Value
- IContentNegotiator
Returns System.Net.Http.Formatting.IContentNegotiator.
Formatters
Gets the formatters to use to negotiate and format the content.
public IEnumerable<MediaTypeFormatter> Formatters { get; }
Property Value
- IEnumerable<MediaTypeFormatter>
Returns IEnumerable<T>.
Message
Gets the user-visible error message.
public string Message { get; }
Property Value
Request
Gets the request message which led to this result.
public HttpRequestMessage Request { get; }
Property Value
- HttpRequestMessage
Returns HttpRequestMessage.
Methods
ExecuteAsync(CancellationToken)
public virtual Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
- Task<HttpResponseMessage>
Returns Task<TResult>.