Ejemplo n.º 1
0
        static void PopulateDTO(List <object> ocRows, object oRow, SqlDataReader rdr)
        {
            SeasonInfoDTO oSeasonInfoDTO = (SeasonInfoDTO)oRow;

            oSeasonInfoDTO.LeagueName     = rdr["LeagueName"].ToString().Trim();
            oSeasonInfoDTO.StartDate      = (DateTime)rdr["StartDate"];
            oSeasonInfoDTO.EndDate        = (DateTime)rdr["EndDate"];
            oSeasonInfoDTO.Season         = rdr["Season"].ToString().Trim();
            oSeasonInfoDTO.SubSeason      = rdr["SubSeason"].ToString().Trim();
            oSeasonInfoDTO.Bypass         = (bool)rdr["Bypass"];
            oSeasonInfoDTO.IncludePre     = (bool)rdr["IncludePre"];
            oSeasonInfoDTO.IncludePost    = (bool)rdr["IncludePost"];
            oSeasonInfoDTO.BoxscoreSource = rdr["BoxscoreSource"].ToString().Trim();
        }
Ejemplo n.º 2
0
        public SeasonInfoDTO MapToSeasonInfoDTO(SeasonEntity source, SeasonInfoDTO target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                target = new SeasonInfoDTO();
            }

            MapToVersionInfoDTO(source, target);
            target.SeasonId   = source.SeasonId;
            target.SeasonName = source.SeasonName;

            return(target);
        }
Ejemplo n.º 3
0
        public SeasonEntity GetSeasonEntity(SeasonInfoDTO source)
        {
            //if (source == null)
            //    return null;
            //SeasonEntity target;

            //if (source.SeasonId == null)
            //    target = new SeasonEntity();
            //else
            //    target = DbContext.Seasons.Find(source.SeasonId);

            //if (target == null)
            //    throw new EntityNotFoundException(nameof(SeasonEntity), "Could not find Entity in Database.", source.SeasonId);

            //return target;
            return(DefaultGet <SeasonInfoDTO, SeasonEntity>(source));
        }
Ejemplo n.º 4
0
        public SeasonEntity MapToSeasonEntity(SeasonInfoDTO source, SeasonEntity target = null)
        {
            if (source == null)
            {
                return(null);
            }
            if (target == null)
            {
                GetSeasonEntity(source);
            }

            if (!MapToRevision(source, target))
            {
                return(target);
            }

            target.SeasonName = source.SeasonName;

            return(target);
        }