funkycooljem
New Member
I have the following code:\[code\] //Pretend there is a few static values in this list List<string> repeatUserIds = new List<string>(); SomeCollection.Where(x => repeatUserIds.Contains(x.UserId)).First().MyCol = "somevalue"; MyEntities.SaveChanges(false); scope.Complete(); MyEntities.AcceptAllChanges(); \[/code\]I also have a \[code\]List<string>\[/code\] object called \[code\]repeatUserIds\[/code\] that contains a list of static UserId's, maybe 5 or so. I want to be able to make my \[code\]SomeCollection.Where(x => repeatUserIds.Contains(x.UserId))\[/code\] statement return the item that has the userid that is OLDEST in the \[code\]repeatUserIds\[/code\] IF there is a match, if no match on \[code\]repeatUserIds\[/code\] (if repeatUserIds.Contains retunrs false), then just return the first item in SomeCollection.