public async Task <IActionResult> PutBWorkCalendar([FromRoute] int id, [FromBody] BWorkCalendar bWorkCalendar) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bWorkCalendar.Id) { return(BadRequest()); } _context.Entry(bWorkCalendar).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BWorkCalendarExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBWorkCalendar([FromBody] BWorkCalendar bWorkCalendar) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BWorkCalendar.Add(bWorkCalendar); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBWorkCalendar", new { id = bWorkCalendar.Id }, bWorkCalendar)); }