private async Task SetWishModelAsync() { if (_signInManager.IsSignedIn(HttpContext.User)) { WishModel = await _wishViewModelService.GetOrCreateWishForUser(User.Identity.Name); } else { GetOrSetWishCookieAndUserName(); WishModel = await _wishViewModelService.GetOrCreateWishForUser(_username); } }
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)); }