public async Task <ActionResult <PeriodCount> > PostPeriodCount(PeriodCount periodCount) { _context.PeriodCounts.Add(periodCount); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPeriodCount", new { id = periodCount.CompanyId }, periodCount)); }
public async Task <IActionResult> PutPeriodCount(int id, PeriodCount periodCount) { if (id != periodCount.CompanyId) { return(BadRequest()); } _context.Entry(periodCount).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PeriodCountExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }