public async Task <ActionResult <Shippng> > PostShippng(Shippng shippng) { AccountsController accres = new AccountsController(dbObj); shippng.AccId = accres.getAccountResponseID(); dbObj.Shippngs.Add(shippng); try { await dbObj.SaveChangesAsync(); } catch (DbUpdateException) { if (ShippngExists(shippng.ShipId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetShippng", new { id = shippng.ShipId }, shippng)); }
public async Task <ActionResult <Billing> > PostBilling(Billing billing) { AccountsController accres = new AccountsController(testDB1Context); billing.AccId = accres.getAccountResponseID(); testDBobj.Billings.Add(billing); try { await testDBobj.SaveChangesAsync(); } catch (DbUpdateException) { if (BillingExists(billing.BillId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetBilling", new { id = billing.BillId }, billing)); }