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); }
public async Task <IEnumerable <CommentModel> > Get(Guid couponId) { var coupon = await _repository.GetByIdWithPhotosAndComments(couponId); return(_mapper.Map <IEnumerable <CommentModel> >(coupon.Comments)); }