Beispiel #1
0
        public Result <TournamentDto> Handle(GetTournamentByName query)
        {
            Tournament tournament = _tournamentRepository.GetTournamentByName(query.TournamentName);

            if (tournament == null)
            {
                return(Result.Failure <TournamentDto>($"Could not find tournament ({ query.TournamentName })"));
            }

            TournamentDto tournamentDto = DomainToDtoConverters.ConvertToTournamentDto(tournament);

            return(Result.Success(tournamentDto));
        }