public async Task <ActionResult <BunkerInfo> > PostBunkerInfo(BunkerInfo bunkerInfo) { _context.BunkerInfos.Add(bunkerInfo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBunkerInfo", new { id = bunkerInfo.BunkerInfoId }, bunkerInfo)); }
public async Task <IActionResult> PutBunkerInfo(int id, BunkerInfo bunkerInfo) { if (id != bunkerInfo.CustQuoteMasterId) { return(BadRequest()); } // _context.Entry(bunkerInfo).State = EntityState.Modified; try { _context.Entry(bunkerInfo).Property(x => x.Fwrecd).IsModified = true; _context.Entry(bunkerInfo).Property(x => x.GasOilRecd).IsModified = true; _context.Entry(bunkerInfo).Property(x => x.Hforecd).IsModified = true; _context.Entry(bunkerInfo).Property(x => x.Mdorecd).IsModified = true; _context.Entry(bunkerInfo).Property(x => x.LastUpdatedBy).IsModified = true; _context.Entry(bunkerInfo).Property(x => x.LastUpdatedDt).IsModified = true; await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BunkerInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }