Exemplo n.º 1
0
        public static ResponseMessageResult GenerateErrorResponse(HttpRequestMessage request, HttpStatusCode httpStatusCode, ErrorCode errorCode, string message)
        {
            var errorList = new List <Error>
            {
                CreateError((int)errorCode, message == null ? errorCode.DescriptionOfValue() : message)
            };

            var responseMsg = request.CreateResponse(httpStatusCode, errorList);

            return(new ResponseMessageResult(responseMsg));
        }