Lets break it down: int? count declares a nullable integer variable named count. count is now a variable which can store either an integer value or NULL.
(from cartItems in storeDB.Carts
where cartItems.CartId == shoppingCartId
This is a LINQ query which returns the Count of the cartItems in a given Cart and sums them. return count ?? 0; Lastly the method returns a value. I am assuming that the method is declared with an 'int' return type and not 'int?' since they are converting a NULL value to 0. The syntax is a shorthand for something like: