Example #1
0
        public async Task <CouponModelExtended> GetById(Guid couponId)
        {
            var coupon = await _couponRepository.GetByIdWithPhotosAndComments(couponId);

            var mappedCoupon = _mapper.Map <CouponModelExtended>(coupon);

            foreach (var comment in mappedCoupon.Comments)
            {
                comment.User.PasswordHash = string.Empty;
            }

            return(mappedCoupon);
        }
Example #2
0
        public async Task <IEnumerable <CommentModel> > Get(Guid couponId)
        {
            var coupon = await _repository.GetByIdWithPhotosAndComments(couponId);

            return(_mapper.Map <IEnumerable <CommentModel> >(coupon.Comments));
        }