public static Microsoft.AspNetCore.Mvc.ContentResult GetContentResult(this OpenActive.Server.NET.OpenBookingHelper.ResponseContent response) { return(new Microsoft.AspNetCore.Mvc.ContentResult { StatusCode = (int)response.StatusCode, Content = response.Content, ContentType = response.ContentType }); }
public static HttpResponseMessage GetContentResult(this OpenActive.Server.NET.OpenBookingHelper.ResponseContent response) { var resp = new HttpResponseMessage { Content = new StringContent(response.Content ?? ""), StatusCode = response.StatusCode }; resp.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(response.ContentType); return(resp); }
public static HttpResponseMessage GetContentResult(this OpenActive.Server.NET.OpenBookingHelper.ResponseContent response) { var resp = new HttpResponseMessage { Content = new StringContent(response.Content ?? ""), StatusCode = response.StatusCode }; resp.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(response.ContentType); // Ensure custom error messages do not override responses HttpContext.Current.Response.TrySkipIisCustomErrors = true; return(resp); }