最佳答案
query.Any()
?
double earnings = db.Leads.Where(l => l.Date.Day == date.Day
&& l.Date.Month == date.Month
&& l.Date.Year == date.Year
&& l.Property.Type == ProtectedPropertyType.Password
&& l.Property.PropertyId == PropertyId).Sum(l => l.Amount);