Can you help me on the following error, i checked everything no ID mistakes
ModelValidationException was un handled by user code
An exception of type 'System.Data.Entity.ModelConfiguration.ModelValidationException' occurred in EntityFramework.dll but was not handled in user code
Additional information: One or more validation errors were detected during model generation:
public int GetCount()
{
ShoppingCartId = GetCartId();
// Get the count of each item in the cart and sum them up
int? count = (from cartItems in _db.ShoppingCartItems
where cartItems.CartId == ShoppingCartId
select (int?)cartItems.Quantity).Sum();
// Return 0 if all entries are null
return count ?? 0;
}
Frustratingly .net does not always show you the inner exception. Wrap your code in a try block with this catch