Distinct on multiple properties in a collection

Problem:
How do I get distinct members of a collection, based on multiple properties?

Solution:
Use MoreLinq to get distinct members of a collection, based on multiple properties.
eg: For our application, each member in the household was supposed to have a unique combination of driver’s licence number and driver’s state.

 
var query = household.DistinctBy(
            counter => new { counter.DriverLicenceNumber, counter.DriverLicenceState });
Continue Reading