MvcMusicStore.Models.ShoppingCart.GetCount C# (CSharp) Method

GetCount() public method

public GetCount ( ) : int
return int
        public int GetCount()
        {
            /*
            // Get the count of each item in the cart and sum them up
            int? count = (from cartItems in storeDB.Carts
                          where cartItems.CartId == ShoppingCartId
                          select (int?)cartItems.Count).Sum();

            // Return 0 if all entries are null
            return count ?? 0;*/
            return GetCartItems().Count();
        }