public async Task <dbObj.Series> BuildDbSeriesAsync(Model.Series series) { var retObj = _mapper.Map <dbObj.Series>(series); if (retObj.RaceSeries == null) { retObj.RaceSeries = new List <dbObj.SeriesRace>(); } if (series.Races != null) { foreach (var race in series.Races) { var dbRace = await BuildDbRaceObj(series.ClubId, race) .ConfigureAwait(false); retObj.RaceSeries.Add(new dbObj.SeriesRace { Series = retObj, Race = dbRace }); } } var dbSeason = await GetSeasonAsync(series.ClubId, series) .ConfigureAwait(false); retObj.Season = dbSeason; return(retObj); }
public Series ToSeries() { Model.Series s = new Model.Series(); s.seriesName = this.original_name; s.firstAired = this.first_air_date; //s.actorList = /series/id/credits s.bannerUrl = this.backdrop_path; s.genresList = new List <Genre>(); foreach (TheMovieDbGenre mdbg in this.genres) { s.genresList.Add(mdbg.ToGenre()); } s.id = this.id; //TODO mas que una? if (this.networks.Count > 0) { s.network = this.networks[0].ToNetwork(); } s.posterUrl = this.poster_path; //TODO promedio? if (this.episode_run_time.Count > 0) { s.runningTime = this.episode_run_time[0]; } s.seasonList = new List <Season>(); foreach (TheMovieDbSeason mdbs in this.seasons) { Season se = mdbs.ToSeason(); se.series = s; s.seasonList.Add(se); } s.seriesDescription = this.overview; s.seriesName = this.name; s.status = this.status; s.tvDbId = this.id; return(s); }
/// <summary> /// Returns an instance of <see cref="SeriesDetails"/> for a <see cref="Series"/>. /// </summary> /// <param name="series"></param> /// <returns></returns> /// <remark> /// /// </remark> static public SeriesDetails CreateSeriesDetails(Model.Series series) { SeriesDetails details = new SeriesDetails(); details.Modality = series.Modality; details.NumberOfSeriesRelatedInstances = series.NumberOfSeriesRelatedInstances; details.PerformedDate = series.PerformedProcedureStepStartDate; details.PerformedTime = series.PerformedProcedureStepStartTime; details.SeriesDescription = series.SeriesDescription; details.SeriesInstanceUid = series.SeriesInstanceUid; details.SeriesNumber = series.SeriesNumber; details.SourceApplicationEntityTitle = series.SourceApplicationEntityTitle; return(details); }