developer

Find an item in List by LINQ?

Question: ❓❓❓ Here I have a simple example to find an item in a list of strings. Normally I use for loop or anonymous delegate to do it like this: int GetItemIndex(string search) { int found = -1; if ( _list != null ) { foreach (string item in _list) Read more…

By admin, ago
developer

Multiple Order By with LINQ

Question: ❓❓❓ I start with a basic class that I want to manipulate in a List using LINQ, something like the following: public class FooBar { public virtual int Id { get; set; } public virtual string Foo{ get; set; } public virtual string Bar{ get; set; } } This Read more…

By admin, ago