Exemplo n.º 1
0
        public HttpResponseMessage Put([FromBody] Harvest harvest)
        {
            int numEffected = 0;

            try
            {
                numEffected = harvest.Update();

                if (numEffected > 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, numEffected));
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Not Found"));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }