public async Task <ActionResult <Dimmaster> > PostDimmaster(Dimmaster dimmaster) { _context.Dimmaster.Add(dimmaster); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDimmaster", new { id = dimmaster.DimId }, dimmaster)); }
public async Task <IActionResult> PutDimmaster(int id, Dimmaster dimmaster) { if (id != dimmaster.DimId) { return(BadRequest()); } _context.Entry(dimmaster).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DimmasterExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }