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)); }