public virtual async Task <WishListSummaryViewModel> GetWishListSummaryViewModelAsync(GetCartParam param)
        {
            if (param == null)
            {
                throw new ArgumentNullException(nameof(param));
            }
            if (string.IsNullOrWhiteSpace(param.Scope))
            {
                throw new ArgumentException(GetMessageOfNullWhiteSpace(nameof(param.Scope)), nameof(param));
            }
            if (param.CultureInfo == null)
            {
                throw new ArgumentException(GetMessageOfNull(nameof(param.CultureInfo)), nameof(param));
            }
            if (string.IsNullOrWhiteSpace(param.CartName))
            {
                throw new ArgumentException(GetMessageOfNullWhiteSpace(nameof(param.CartName)), nameof(param));
            }
            if (param.CustomerId == Guid.Empty)
            {
                throw new ArgumentException(GetMessageOfEmpty(nameof(param.CustomerId)), nameof(param));
            }

            var wishList = await WishListRepository.GetWishListAsync(param).ConfigureAwait(false);

            if (wishList == null)
            {
                return(null);
            }

            return(CreateSummaryWishListViewModel(new CreateWishListViewModelParam
            {
                WishList = wishList,
                CultureInfo = param.CultureInfo,
                BaseUrl = param.BaseUrl,
                WebsiteId = param.WebsiteId
            }));
        }
 public WishListController(WishListRepository _wishListRepository, IHostingEnvironment _environment)
 {
     wishListRepository = _wishListRepository;
     environment        = _environment;
 }
 public WishListController()
 {
     _wishListRepository = new WishListRepository();
 }
Example #4
0
 public WishListService(WishListRepository _wishListRepository, IHostingEnvironment _environment)
 {
     wishListRepository = _wishListRepository;
     environment        = _environment;
 }
Example #5
0
 public WishListManager(WishListRepository wishList)
 {
     this.wishList = wishList;
 }