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