Pattern matching was introduce in C# 7.0. But, you don’t remember. Pattern matching is a feature that allows you to implement method dispatch on properties other than the type of an object. Now, with the upcoming release of C# 8.0 pattern…
Tag: C#
How to compare Tuples?
A few days back I was asked, How to compare tuples? This is currently a easy task to accomplish thanks to C# 7.3. On that release, support for the == and the != operator was added. The operators work by…
Expression-bodied members in C#
Expression-body members is one of those updates that no many developer known about. I have encountered many cases some developer first thought is “A property?”. Part of the reason many developer have yet to embrace expression-bodied members is the lack…
Out Variables in C#
Out variables are not my go to variables because I rarely write in a way where I have to use out variables. But for some developer this is somewhat of a daily bread, specially if they are dealing with old…
Resilient Entity Framework Core SQL Connections
SQL connections resilient in EF Core is way to easy to setup. With a few lines of code we can have things like try to connect X amount of time if connection fails the first time. Besides, connection resiliency we…
Using HttpClientFactory
We all have used HttpClient in some point of our career, special when you consume APIs. HttpClient has been with us since .Net Framework 4.5. Now, with ASP.NET Core 2.1 HttpClientFactory allow us to solve multiple problems that the predecessor…
C# Switch expressions
C# 8 brings several good features, one of them is switch expressions. In the previous version I took advantage of using Switch statements with patterns. On C# 7x patterns were introduced into switch statements, which added a powerful tool for…