Пример #1
0
        public HttpResponseMessage UpdatePlant(PlantUpdateRequest model, int id)
        {
            // If the Model does not pass validation, then return Error response with errors
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            SuccessResponse response = new SuccessResponse();

            _plantsService.UpdatePlant(model);

            return(Request.CreateResponse(response));
        }
Пример #2
0
 public void UpdatePlant(PlantUpdateRequest model)
 {
     DataProvider.ExecuteNonQuery(GetConnection, "dbo.Plants_Update"
                                  , inputParamMapper : delegate(SqlParameterCollection paramCollection)
     {
         paramCollection.AddWithValue("@Id", model.Id);
         paramCollection.AddWithValue("@Name", model.Name);
         paramCollection.AddWithValue("@Description", model.Description);
         paramCollection.AddWithValue("@Keywords", model.Keywords);
         paramCollection.AddWithValue("@CategoryId", model.CategoryId);
         paramCollection.AddWithValue("@SizeId", model.SizeId);
         paramCollection.AddWithValue("@IsBioluminescent", model.IsBioluminescent);
     }
                                  , returnParameters : delegate(SqlParameterCollection param)
     {
     }
                                  );
 }