How can I do this SQL query with Entity Framework?
SQL
Entity Framework
SELECT DISTINCT NAME FROM TestAddresses
Try this:
var results = (from ta in context.TestAddresses select ta.Name).Distinct();
This will give you an IEnumerable - you can call .ToList() on it to get a List.
IEnumerable
.ToList()
List