Web developers use optional LINQ Distinct clause when they want to receive a list of unique items. The Distinct clause ignores duplicate query results and can be applied to duplicate values for all return fields specified by the Select clause. If no Select clause is specified, the Distinct clause is applied to the range variable for the query identified in the From clause. If the range variable is not an immutable type, the query will only ignore a query result if all members of the type match an existing query result.

C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development: Build applications with C#, .NET Core, Entity Framework Core, ASP.NET Core, and ML.NET using Visual Studio Code, 4th Edition
ASP.NET Core 3 and Angular 9: Full stack web development with .NET Core 3.1 and Angular 9, 3rd Edition
C# in Depth, 4th Edition

The following query expression joins a list of clients and a list of client orders. The Distinct clause is included to return a list of unique client names and order products.


Dim clientOrders = From client In clients, ord In orders _

Where client.ClientID = ord.ClientID _

Select client.Company, ord.ProductName _