示例#1
0
    private async Task <int> CountTotalBasketItems()
    {
        if (_signInManager.IsSignedIn(HttpContext.User))
        {
            return(await _basketService.CountTotalBasketItems(User.Identity.Name));
        }

        string anonymousId = GetAnnonymousIdFromCookie();

        if (anonymousId == null)
        {
            return(0);
        }

        return(await _basketService.CountTotalBasketItems(anonymousId));
    }