public IActionResult Post([FromBody] Models.DbSinDarEla.Protokoll item) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (item == null) { return(BadRequest()); } this.OnProtokollCreated(item); this.context.Protokolls.Add(item); this.context.SaveChanges(); var key = item.ProtokollID; var itemToReturn = this.context.Protokolls.Where(i => i.ProtokollID == key); Request.QueryString = Request.QueryString.Add("$expand", "Base"); return(new ObjectResult(SingleResult.Create(itemToReturn)) { StatusCode = 201 }); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return(BadRequest(ModelState)); } }
partial void OnProtokollUpdated(Models.DbSinDarEla.Protokoll item);