@foreach (var item in Model) { string mytown = item.town.*enter distinct here* <option value="@mytown"> @mytown</option>
This selects all the town names in my database and I've got it to display in a drop down menu.
How can I change this so that when it's displaying the town names, it will only show each town name once.
For example, if I have 3 londons in the database it will show all 3 londons in the drop down menu. I want it to only show 1 london
FYI: Sorry this may seem like a repost but I posted the wrong code earlier
Distinct.