public ActionResult Post([FromBody] store store) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.stores.Add(store); db.SaveChanges(); return(CreatedAtAction("Post", store)); }
public ActionResult Post([FromBody] item item) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.items.Add(item); db.SaveChanges(); return(CreatedAtAction("Post", item)); }