ASP.NET Core: appsettings.json

Using AppsSettings.Json to Store/Retrieve data In this article I’ll demonstrate how to use Microsoft’s replacement configuration file to web.config, appsettins.json. Similar to all .json files, this change means much easier config file for projects due to its simple attribute–value pairs and arrays format, over the highly proprietary web.config file format, which changes often with each…

C# Language Integrate Query (LINQ)

Please see my other C# articles. LINQ – All to test a collection LINQ – Any() to test a collection   LINQ: Call Custom Method LINQ – Distinct for unique values LINQ – Equality Comparer LINQ: Filtering by Custom Extension LINQ: Query LINQ: Set Operator LINQ: Skip N number objects LINQ: SkipWhile to get objects…

C#: LINQ – Any() to test a collection

Please see my other LINQ articles. Use Any() to test an entire collection. In this article I’ll demonstrate how to use Any() to determine any object in the collection matches a search predicate. First, I’ll get a collection of static People objects. In the statement, I apply Any() on the people objects’ FirstName property to determine if…

C#: LINQ – All() to test a collection

Please see my other LINQ articles. Use All() to test an entire collection. In this article I’ll demonstrate how to use All() to determine if the entire collection matches a search predicate. First, I’ll get a collection of static People objects. In the statement, I apply All() on the people objects’ LastName property to determine if…

C#: LINQ – Distinct to get unique values

Please see my other LINQ articles. Use Distinct() during select to retrieve a unique list. In this article I’ll demonstrate how to use Distinct() during Select() to generate a unique list of car makes. First, I’ll get a collection of static Car objects. In the section statement, I perform a select on the car objects’ Make property,…

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…