07-24-2023, 11:39 AM
I have this query:
int maxShoeSize = Workers
.Where(x => x.CompanyId == 8)
.Max(x => x.ShoeSize);
What will be in `maxShoeSize` if company 8 has no workers at all?
**UPDATE:**
How can I change the query in order to get 0 and not an exception?
int maxShoeSize = Workers
.Where(x => x.CompanyId == 8)
.Max(x => x.ShoeSize);
What will be in `maxShoeSize` if company 8 has no workers at all?
**UPDATE:**
How can I change the query in order to get 0 and not an exception?