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(); }
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); }
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)); }
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); }