You can do it simply with Linq. Given that you need an object with the earliest dStart , you can do the following:
List<EntityAuftrag> list = someSourceOfItems; EntityAuftrag firstObject = list.OrderBy( i => i.dStart ).First() as EntityAuftrag;
Alternatively (not sure if the correct syntax is above), you can do it like this:
List<EntityAuftrag> list = someSourceOfItems; EntityAuftrag firstObject = (from item in list orderby item.dStart select item).Single() as EntityAuftrag;
Enjoy your day :-)
source share