示例#1
0
        public HttpResponseMessage Post([FromBody] Employee model)
        {
            var response = _service.AddEmployee(model);

            if (response.IsValid)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, response.Content));
            }
            return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, new Exception(response.ErrorMessage)));
        }