C#: LINQ – SkipWhile to get objects

Please see my other LINQ articles. Use SkipWhile() to include a condition for skipping objects. In this article I’ll demonstrate how to use SkipWhile() to set a condition on which to skip objects when building a collection. First, I’ll get a collection of static Person objects. Now I’ll call SkipWhile() on my collection using Method syntax and…

C#: LINQ – Skip N number objects during get

Please see my other LINQ articles. Use Skip() to ignore n when getting objects. In this article I’ll demonstrate how to use Skip() to ignore a set number of objects when building a collection. First, I’ll get a collection of static Person objects. Now I’ll call Skip() on my collection using Method syntax and only retrieve the…

C#: LINQ – TakeWhile to get objects

Please see my other LINQ articles. Use TakeWhile() to include a condition for getting objects. In this article I’ll demonstrate how to use TakeWhile() to set a condition on which to get a collection of objects . First, I’ll get a collection of static Person objects. Now I’ll call TakeWhile() on my collection using Method syntax and…

C#: LINQ – Take first N number objects

Please see my other LINQ articles. Use Take() to get the first n number of elements. In this article I’ll demonstrate how to use Take() to get a variable number of objects from the front of a collection like the TOP t-sql keyword. First, I’ll get a collection of static Person objects. Now I’ll call Take() on…

C#: LINQ – Set Using Custom Method

Please see my other LINQ articles. Using a Custom Method during a set operation In this article I’ll demonstrate how to call a custom method during a LINQ query. In my previous article, I demonstrated how to use the SET operator during a query. In this example, I’ll perform another set task, but this time using a…

C#: LINQ – Call Custom Method

Please see my other LINQ articles. Using a Custom Method during a Query In this article I’ll demonstrate how to call a custom method during a LINQ query. In my previous article, I demonstrated how to use the SET operator during a query. In this example, I’ll perform another set task, but this time using a custom…

C#: LINQ – Set Operator

Please see my other LINQ articles. Use LINQ to update values during a query. This article will demonstrate how to perform a SET, similar to sql SET during a query. First, I’ll populate a List<T> collection of Person objects. Now, I’ll call ForEach() on each person object, assigning the length of FirstName to the FNameLen property of…

C#: LINQ – Filtering by Custom Extension

Please see my other LINQ articles. Extending LINQ to perform custom searches In this article, I’ll demonstrate how to create a custom extension in LINQ which may be used to extend searching capability on collections. In my C#: Json – Populate objects from a file I demonstrated how to read objects from a file. Now, I’ll update…

C#: Json – Populate objects from a file

Please see my other C# articles. Reading data from a file into objects In this article I’ll demonstrate how to use Json to read a file’s contents and populate a list of objects with that data. First, I’ll create a method which uses reads data from a Json file into a string, which Json then uses to…

C#: File I/O – Populate objects from a file

Please see my other C# articles. Reading data from a file into objects In this article I’ll demonstrate how to read a file’s contents and populate a list of objects with that data. First, I’ll create a method which uses reads data from a Json file into a string, which Json then uses to uses to convert…