public async Task <IList <WishlistResponseModel> > GetWishlistitems()
        {
            var items = await _whishlistRepository.GetAll();

            return(items.Select(x => new WishlistResponseModel
            {
                Id = x.Id
            }).ToList());
        }
示例#2
0
 public IEnumerable <Wishlist> GetAll(string input)
 {
     if (!string.IsNullOrEmpty(input))
     {
         return(_wishlistRepository.GetMulti(x => x.Product.Name.Contains(input), new string[] { "Product" }));
     }
     else
     {
         return(_wishlistRepository.GetAll(new string[] { "Product" }));
     }
 }
        public List <WishlistGridModel> GetMyWishlist(string ownerId, Guid countryId)
        {
            List <WishlistGridModel> listGridModel = new List <WishlistGridModel>();
            var wishlists = _repository.GetAll(ownerId, countryId);

            foreach (var wishlist in wishlists)
            {
                listGridModel.Add(WishlistMapper.MapToWishlistGridModel(wishlist, _adService.GetAdAsAdWishlistGridModel(wishlist.AdId)));
            }

            return(listGridModel);
        }
        IEnumerable <WishlistDTO> IWishlistService.GetAll()
        {
            var result = wishlistRepository.GetAll();

            return(Mapper.Map <IEnumerable <Wishlist>, IEnumerable <WishlistDTO> >(result));
        }