Answers for "icollection get item"

C#
1

get item from icollection

var foo = myICollection.OfType<YourType>().FirstOrDefault();
// or use a query
var bar = (from x in myICollection.OfType<YourType>() where x.SomeProperty == someValue select x)
	.FirstOrDefault();
Posted by: Guest on November-19-2020

C# Answers by Framework

Browse Popular Code Answers by Language