I'm trying to get all the info (column, rows) from a table in SQL and send it as a model to the view.
I also want it to be Distinct.
My controller:
MVCEntities me = new MVCEntities();
List<CarsCategory> arr = me.CarsCategories.ToList();
return View(arr);
My view model:
@model IEnumerable<CarsCategory>
In the view I'm trying to loop through a certain column like this:
<select id="SelectManufacturer">
@foreach (var i in Model)
{
<option value="@i.Manufacturer">@i.Manufacturer</option>
}
</select>
How do I make it Distinct? When I try to add Distinct it gives me system.linq.enumerable+<DistinctIterator> ..