I need to check if a postcode is within a given start and end postcode, using linq.
Here is what I have so far but it’s not right at all, can someone point me in the right direction?
List<DestinationStation> stations = DestinationStation.GetDestinationStations();
var query = from s in stations
where postcode <= s.FromPostcode && postcode >= s.ToPostcode
select s;
Console.WriteLine(query.ToList());
Try
CompareTofor strings. Does this work?