I have these models:
public class StationData
{
public List<StationToStationModel> Distances { get; set; }
public List<int> SortestPath { get; set; }
}
public class StationToStationModel
{
public int FromStation { get; set; }
public int ToStation { get; set; }
public int Distance { get; set; }
}
In my main page, I call a method that will return an object of type “StationData”.
Now, what I want is to get the “ToStation” value where “Distance” is the smallest distance value in the given list of StationToStationModel. How to do that?
Thanks
RJ
Try this: