How can I do this SQL query with Entity Framework?
SQL
Entity Framework
SELECT DISTINCT NAME FROM TestAddresses
In order to avoid ORDER BY items must appear in the select list if SELECT DISTINCT error, the best should be
ORDER BY items must appear in the select list if SELECT DISTINCT
var results = ( from ta in DBContext.TestAddresses select ta.Name ) .Distinct() .OrderBy( x => 1);