Пример #1
0
        public static DomainResult Create(
            TeamReadModel teamAtHome,
            TeamReadModel teamAsGuest)
        {
            if (teamAtHome.TeamId == teamAsGuest.TeamId)
            {
                return(DomainResult.Error(new TeamsCanNotBeTheSame(teamAtHome.TeamId, teamAsGuest.TeamId)));
            }

            return(Create(Guid.NewGuid(), teamAtHome, teamAsGuest));
        }
Пример #2
0
        public static DomainResult Create(
            Guid matchId,
            TeamReadModel teamAtHome,
            TeamReadModel teamAsGuest)
        {
            if (teamAtHome.TeamId == teamAsGuest.TeamId)
            {
                return(DomainResult.Error(new TeamsCanNotBeTheSame(teamAtHome.TeamId, teamAsGuest.TeamId)));
            }

            return(DomainResult.Ok(new MatchCreated(matchId, teamAtHome.TeamId, teamAsGuest.TeamId)));
        }
Пример #3
0
        public DomainResult Start(TeamReadModel teamAtHome, TeamReadModel teamAsGuest)
        {
            var matchStarted = new MatchStarted(MatchId, teamAtHome.Players, teamAsGuest.Players);

            return(DomainResult.Ok(matchStarted));
        }