Struggling to get my count correct. I believe I am close but I need it to return 0 if there are no records in the database. The compiler doesnt like what I have now. Any help would be appreciated. Thanks
var count = (_db.cart.Where(c => c.UserId == id)
.Select(c => (int) c.Quantity)).ToList().Count() ?? 0;