Hi i have a linq query below
var Free = (from row in
dt.AsEnumerable()
where row.Field(“AppointmentType”)
== “FreeTime”
select new{ row.Field(“BookedDate”)
row.Field(“TravelTime”)}).Min()
what i want to do is have a minimum on the travelTime field and im not sure on how to do it i have looked on google and also on the msdn site but i cant seem to make head or tail of it
does anyone have any ideas??
Many thanks
You could use an overload for
Enumerable.Min():Actually, there is no need to look at the
BookedDateand you should instead useI kept your original code with a few modifications to demonstrate the syntax for creating anonymous types.