public async Task <IHttpActionResult> PostSupplier(Supplier supplier) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { await _SVC.AddSupplier(supplier); } catch (DbUpdateException) { if (SupplierExists(supplier.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = supplier.ID }, supplier)); }
async public Task <ActionResult> Add(Supplier item) { return(Content(await _Server.AddSupplier(item))); }