/// <summary> /// Updates the round. /// </summary> /// <param name="id">The identifier.</param> /// <param name="model">The model.</param> /// <returns></returns> /// <exception cref="Exception">Round id not found</exception> public async Task <Round> UpdateRound(Guid id, RoundUpdateModel model) { var result = _roundRepository.GetById(id); if (result == null) { throw new Exception("Round id not found"); } result.MoneyRaised = model.MoneyRaised; result.Name = model.Name; result.RoundDate = model.RoundDate; result.ShareIncreased = model.ShareIncreased; _roundRepository.Update(result); await _unitOfWork.CommitAsync(); return(result); }
public async Task <Round> UpdateRound([FromRoute] Guid id, [FromBody] RoundUpdateModel model) { Response.StatusCode = (int)HttpStatusCode.OK; return(await _roundService.UpdateRound(id, model)); }
public async Task Update(RoundUpdateModel model) { await _gameRoundService.Update(model.id, model.Name, model.Duration); }