I understand that Distinct()
returns distinct elements from a sequence by using the default equality comparer to compare values. But I don't quite understand how this works in Entity Framework.
For example, if I have:
return dbContext.Products.Select(p => p.Dealer).Distinct();
How would the generated SQL decide if a Dealer
equals another Dealer
? Does it compare all the columns, or do something else?