public void Handle(EditMatchRequest request) { try { var match = _matchRepo.Get(request.Id); match.FirstTeam = GetTeamById(request.IdFirstTeam); match.SecondTeam = GetTeamById(request.IdSecondTeam); match.DateTimeMatch = request.DateTimeMatch; match.ScoreOfFirstTeam = request.ScoreOfFirstTeam; match.ScoreOfSecondTeam = request.ScoreOfSecondTeam; _matchRepo.Replace(match); var response = new EditMatchResponse(true); Sender.Tell(response); _logger.Info("Edit Match successfull: {0} {1}", match.FirstTeam, match.SecondTeam); } catch (Exception ex) { var response = new EditMatchResponse(false); Sender.Tell(response); _logger.Error("Couldn't edit Match: {0}: {1}", request.Id, ex.Message); } }
public async Task <EditMatchResponse> EditMatch(string id, string idFirstTeam, string idSecondTeam, string dateTimeMatch, int scoreOfFirstTeam, int scoreOfSecondTeam) { var request = new EditMatchRequest(id, idFirstTeam, idSecondTeam, dateTimeMatch, scoreOfFirstTeam, scoreOfSecondTeam); return(await _matchActor.Ask <EditMatchResponse>(request)); }