public async Task <ActionResult <VentureSchedule> > PostVentureSchedule(VentureSchedule ventureSchedule) { _dbContext.VentureSchedule.Add(ventureSchedule); await _dbContext.SaveChangesAsync(); return(CreatedAtAction("GetVentureSchedule", new { key = ventureSchedule.VentureScheduleKey }, ventureSchedule)); }
public async Task <IActionResult> PutVentureSchedule(Guid key, VentureSchedule ventureSchedule) { if (key != ventureSchedule.VentureScheduleKey) { return(BadRequest()); } _dbContext.Entry(ventureSchedule).State = EntityState.Modified; try { await _dbContext.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VentureScheduleExists(key)) { return(NotFound()); } else { throw; } } return(NoContent()); }