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