public async Task <ActionResult <MLedgerHeads> > PostMLedgerHeads(MLedgerHeads mLedgerHeads) { _context.MLedgerHeads.Add(mLedgerHeads); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMLedgerHeads", new { id = mLedgerHeads.Id }, mLedgerHeads)); }
public async Task <IActionResult> PutMLedgerHeads(decimal id, MLedgerHeads mLedgerHeads) { if (id != mLedgerHeads.Id) { return(BadRequest()); } _context.Entry(mLedgerHeads).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MLedgerHeadsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }