public async Task<IHttpActionResult> Post(Supplier supplier) { supplier.ProductFamilies = null; Supplier addedSupplier = _db.Suppliers.Add(supplier); await _db.SaveChangesAsync(); return StatusCode(HttpStatusCode.NoContent); }
public HttpResponseMessage Post(Supplier supplier) { supplier.ProductFamilies = null; Supplier addedSupplier = _db.Suppliers.Add(supplier); _db.SaveChanges(); return Request.CreateResponse(HttpStatusCode.Created, addedSupplier); }
public async Task<IHttpActionResult> Post(Supplier supplier) { supplier.ProductFamilies = null; Supplier addedSupplier = _db.Suppliers.Add(supplier); await _db.SaveChangesAsync(); return Created(addedSupplier); }