public IActionResult Put(Guid id, [FromBody] RoundUpsertModel round) { Round foundRound; if (rounds.TryGetValue(id, out foundRound)) { rounds[id].users = round.users; rounds[id].currentUser = round.currentUser; return(Ok()); } return(NotFound()); }
public IActionResult Post([FromBody] RoundUpsertModel newRound) { Round roundToSave = new Round() { roundId = Guid.NewGuid(), currentUser = newRound.currentUser, partyName = newRound.partyName, users = newRound.users ?? new List <Guid>() }; rounds.Add(roundToSave.roundId, roundToSave); return(CreatedAtAction("Get", new { roundToSave.roundId }, roundToSave)); }