private static Message NoServiceError(RequestMessage request) { ResponseMessage response = request.CreateResponse(); response.Arguments.Add(new MessageError(new Exception("The service requested is not being run on the instance"))); return(response); }
/// <summary> /// Executes this <see cref="IHttpActionResult"/> to retrieve a <see cref="HttpResponseMessage"/> from the view data. /// </summary> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>The <see cref="HttpResponseMessage"/> representing the view data.</returns> public Task <HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken) { var response = RequestMessage.CreateResponse(HttpStatusCode.OK, this, TextHtmlMediaType); return(Task.FromResult(response)); }