Git: Setup a New Repository

Use Git to Setup a New Repository In this article I’ll demostrate how to use the Git bash command-line to setup a new repo. First, I’ll start with a new empty folder in which I plan to store a development solution. Now I’m ready to initialize the new folder as a git folder, create a…

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# Interfaces – Extending Behavior

Architecting Behavior for Extensibility When designing class behavior, it’s important to remember in the implementation of those objects, future changes are certain, necessitating flexibility to evolving requirements. Extensibility in Design When designing behavior in classes, you can simply define functions to be used as object methods, but that assumes the details of each function need…

C# Language Integrate Query (LINQ)

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

C#: LINQ – Equality Comparer

Please see my other LINQ articles. Implement an Equality Comparer to customize Contains(). In this article I’ll demonstrate how to override Contains() when searching a collection to specify which properties of objects to search. First, I’ll get a collection of static People objects. Now, I’ll implement a custom Equality Comparer class where I’ll override Equals() to search…

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…