Hello I would like to select a list of cities from DB, with no duplicate names. After researching the issue I have tried multiple combinations using First and Distinct but I cannot seem to get the syntax right.
Any insight would be great. Below is my code
TABLE
Cities
PK Id
Name
IsActive
C#
var cities = await Db.Addresses.Where(x => x.IsActive == true).Distinct().ToListAsync();