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
名称和日期可能同时发生,但将有一个独特的解决办法。
我认为:
UserObj user = userObjList.Where(u => ((u.Name ==inputName) && (userObjList.Min())).ToList()[0];
但不能确定如何规定最低条件?