public IActionResult PutParameter(int key, [FromBody] Models.Sde.Parameter newItem) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (newItem == null || (newItem.ParameterId != key)) { return(BadRequest()); } this.OnParameterUpdated(newItem); this.context.Parameters.Update(newItem); this.context.SaveChanges(); var itemToReturn = this.context.Parameters.Where(i => i.ParameterId == key); Request.QueryString = Request.QueryString.Add("$expand", "Extract"); this.OnAfterParameterUpdated(newItem); return(new ObjectResult(SingleResult.Create(itemToReturn))); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return(BadRequest(ModelState)); } }
partial void OnParameterDeleted(Models.Sde.Parameter item);
partial void OnAfterParameterUpdated(Models.Sde.Parameter item);
partial void OnParameterCreated(Models.Sde.Parameter item);