This project is read-only.

Error in GetCount () does not come out of the infinite loop.

Apr 19, 2016 at 7:24 PM
"An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll"

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;