I have a List where UserObj has a DateTime data member and a string Name member. I want to find the UserObj in the list with given Name InputName and with DateTime closest to an input DateTime InputDT
The Names and DateTimes may both occur but there will be a unique solution.
I thought about:
UserObj user = userObjList.Where(u => ((u.Name ==inputName) && (userObjList.Min())).ToList()[0];
But not sure how to specify the minimum condition?