Пример #1
0
        public Team ToTeam(TeamEntity teamEntity)
        {
            Sport teamSport     = sportConverter.ToSport(teamEntity.Sport);
            Team  convertedTeam = new Team(teamEntity.TeamNumber, teamEntity.Name, teamEntity.Photo, teamSport);

            return(convertedTeam);
        }
        public Encounter ToEncounter(EncounterEntity anEncounter, ICollection <EncounterTeam> playingTeams)
        {
            ICollection <Commentary> comments = anEncounter.Commentaries.Select(ce => commentConverter.ToComment(ce)).ToList();
            ICollection <Team>       teams    = playingTeams.Select(tm => teamConverter.ToTeam(tm.Team)).ToList();
            DateTime  date    = anEncounter.Date;
            Sport     sport   = sportConverter.ToSport(anEncounter.SportEntity);
            Encounter created = factory.CreateEncounter(anEncounter.Id, teams, date, sport, comments);

            if (anEncounter.HasResult)
            {
                Result matchResult = ToResults(playingTeams);
                created.Result = matchResult;
            }
            return(created);
        }