ÞÄTRÏÇK ÞÄTRÏÇK - 4 months ago 78
C# Question

Entity Framework select distinct name

How can I do this SQL query with Entity Framework?

SELECT DISTINCT NAME FROM TestAddresses

Answer

Using lambda expression..

 var result = EFContext.TestAddresses.Select(m => m.Name).Distinct();