public async Task <IActionResult> PutUserLeagueSchedule(int id, UserLeagueSchedule userLeagueSchedule) { if (id != userLeagueSchedule.Id) { return(BadRequest()); } _context.Entry(userLeagueSchedule).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserLeagueScheduleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <UserLeagueSchedule> > PostUserLeagueSchedule(UserLeagueSchedule userLeagueSchedule) { _context.UserLeagueSchedules.Add(userLeagueSchedule); await _context.SaveChangesAsync(); return(CreatedAtAction("GetUserLeagueSchedule", new { id = userLeagueSchedule.Id }, userLeagueSchedule)); }