public async Task <IHttpActionResult> PostNation(Nation nation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { await _SVC.AddNation(nation); } catch (DbUpdateException) { if (NationExists(nation.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = nation.ID }, nation)); }
async public Task <ActionResult> Add(Nation item) { return(Content(await _Service.AddNation(item))); }