public async Task <Cart> GetCart() { Cart cart = await sessionHelper.GetObjectFromJson <Cart>("cart"); if (cart == null) { cart = new Cart(); await sessionHelper.SetObjectAsJsonAsync("cart", cart); } return(cart); }
/// <summary> /// Wrapper for all save session actions /// </summary> /// <typeparam name="T">Saved object type</typeparam> /// <param name="key">Session dictionary key</param> /// <param name="value">Saved object</param> private async Task ProductChange <T>(string key, T value) { await sessionHelper.SetObjectAsJsonAsync(key, value); }