public async Task <ActionResult <MledgerGroup> > PostMledgerGroup(MledgerGroup mledgerGroup) { _context.MledgerGroup.Add(mledgerGroup); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMledgerGroup", new { id = mledgerGroup.Id }, mledgerGroup)); }
public async Task <IActionResult> PutMledgerGroup(int id, MledgerGroup mledgerGroup) { if (id != mledgerGroup.Id) { return(BadRequest()); } _context.Entry(mledgerGroup).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MledgerGroupExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }