public ActionResult Post([FromBody] team t) { if (ModelState.IsValid) { db.teams.Add(t); db.SaveChanges(); return(CreatedAtAction("Post", t)); } return(BadRequest(ModelState)); }
public ActionResult Post([FromBody] player p) { if (ModelState.IsValid) { db.players.Add(p); db.SaveChanges(); return(CreatedAtAction("Post", p)); } return(BadRequest(ModelState)); }