All Operator Includes Empty Collection

If you have not used All operator with LINQ query, you will realize that ALL operator will include collection that meet the criteria condition as well include collection that is empty. So if you have a query where you are trying to find customers who have all orders that are placed in city of London, than your customer results would include orders from city of London as well customers who have not place any orders at all. Let's take a look at an example.

image

image

In the above code, you will notice that in the criteria for customers who has all order in the city of London, I have some customers who do not have any orders at all.

No Comments