I created following viewmodel for getting from my DB all the results from 3 tables in a single list:
public class ResultsVM
{
public Room room { get; set; }
public Hotel hotel { get; set; }
public List<Picture> pictures { get; set; }
}
I'm then passing my View a list of ResultsVM
@model List <ResultsVM>
Now I'm trying to extract from this list a new list with the distinct object Hotel.
Is there a way to achieve it with Linq or shall I make a loop and compare them one by one?