public static HttpResponseMessage CreateRequiredResponse(this HttpRequestMessage request, string paramName) { var additionalInfo = new JObject { { "ParamName", paramName }, }; return(request.CreateErrorCodeResponse(HttpStatusCode.BadRequest, "Parameter is required", additionalInfo)); }
public static HttpResponseMessage CreateNotFoundResponse(this HttpRequestMessage request, string type, string id) { var additionalInfo = new JObject { { "Type", type }, { "Id", id }, }; return(request.CreateErrorCodeResponse(HttpStatusCode.NotFound, "Object is not found", additionalInfo)); }
public static HttpResponseMessage CreateBadFormatResponse(this HttpRequestMessage request, string paramName, string format = null) { var additionalInfo = new JObject { { "ParamName", paramName }, }; if (format != null) { additionalInfo["Format"] = format; } return(request.CreateErrorCodeResponse(HttpStatusCode.BadRequest, "Input value is incorrect format", additionalInfo)); }