Esempio n. 1
0
        internal static Season Convert(DatabaseAccess.ExternalModel.Season season)
        {
            Season newSeason = new Season();

            newSeason.SeasonId     = season.SeasonId;
            newSeason.ShortName    = season.ShortName;
            newSeason.LongName     = season.LongName;
            newSeason.StartDate    = season.StartDate;
            newSeason.EndDate      = season.EndDate;
            newSeason.WinterSeason = season.WinterSeason;

            return(newSeason);
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> Get(string seasonReference)
        {
            bool converts = int.TryParse(seasonReference, out int seasonId);

            if (converts == false)
            {
                return(BadRequest());
            }

            DatabaseAccess.ExternalModel.Season databaseSeason = await _seasonRepository.GetSeasonAsync(seasonId);

            Models.Season season = Models.Season.Convert(databaseSeason);

            season.Link = Url.Content("~/") + "season/" + databaseSeason.SeasonId;

            return(Ok(season));
        }