コード例 #1
0
        private async Task <PromotionEntity> validatPromotionId(int id, bool showComments = false)
        {
            var promotion = await premierLeagueRepository.GetPromotionAsync(id);

            if (promotion == null)
            {
                throw new NotFoundItemException($"cannot found promotion with id {id}");
            }

            return(promotion);
        }
コード例 #2
0
        public async Task <Promotion> GetPromotionAsync(int id, bool showComments)
        {
            //validatPromotionId(id);
            //var promotion = premierLeagueRepository.GetPromotion(id, showComments);
            //return promotion;
            var promotion = await premierLeagueRepository.GetPromotionAsync(id, showComments);

            if (promotion == null)
            {
                throw new NotFoundItemException("promotion not found");
            }

            return(mapper.Map <Promotion>(promotion));
        }