public async Task <IActionResult> PutSellEntryDetail([FromRoute] int id, [FromBody] SellEntryDetail sellEntryDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != sellEntryDetail.ItemId) { return(BadRequest()); } _context.Entry(sellEntryDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SellEntryDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostSellEntryDetail([FromBody] SellEntryDetail sellEntryDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.sellEntryDetails.Add(sellEntryDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSellEntryDetail", new { id = sellEntryDetail.ItemId }, sellEntryDetail)); }