예제 #1
0
        public static MatchViewModel Convert(Match match)
        {
            MatchViewModel model = new MatchViewModel();

            model.AwayTeamId  = match.AwayTeamId;
            model.HomeTeamId  = match.HomeTeamId;
            model.Id          = match.MatchId;
            model.LeagueID    = match.LeagueID;
            model.SessionId   = match.LeagueSessionScheduleId;
            model.MatchResult = match.MatchResult == null ? null : MatchResultConverter.Convert(match.MatchResult);

            return(model);
        }
예제 #2
0
        public static List <MatchViewModel> ConvertList(IEnumerable <Match> matches)
        {
            return(matches.Select(match =>
            {
                MatchViewModel model = new MatchViewModel();
                model.DateTime = match.DateTime;
                model.AwayTeamId = match.AwayTeamId;
                model.HomeTeamId = match.HomeTeamId;
                model.Id = match.MatchId;
                model.LeagueID = match.LeagueID;
                model.SessionId = match.LeagueSessionScheduleId;
                model.MatchResult = match.MatchResult == null ? null : MatchResultConverter.Convert(match.MatchResult);

                return model;
            }).ToList());
        }