예제 #1
0
 private async Task SetWishModelAsync()
 {
     if (_signInManager.IsSignedIn(HttpContext.User))
     {
         WishModel = await _wishViewModelService.GetOrCreateWishForUser(User.Identity.Name);
     }
     else
     {
         GetOrSetWishCookieAndUserName();
         WishModel = await _wishViewModelService.GetOrCreateWishForUser(_username);
     }
 }
예제 #2
0
        private async Task <WishViewModel> GetWishViewModelAsync()
        {
            if (_signInManager.IsSignedIn(HttpContext.User))
            {
                return(await _basketService.GetOrCreateWishForUser(User.Identity.Name));
            }
            string anonymousId = GetWishIdFromCookie();

            if (anonymousId == null)
            {
                return(new WishViewModel());
            }
            return(await _basketService.GetOrCreateWishForUser(anonymousId));
        }