Authentication handler in ASP.Net Core (JWT and Custom)

Authentication is the process that helps identify who is the users. On the other hand, authorization is the process of determining what a user can do. For authorization to work, the user will be authenticated first. We need the user’s identity to identify the role of a user and act accordingly. Authentication middleware is responsible … Read more

Redis Cache in .Net Core – Docker Container

Using a caching solution becomes important when we are building a high performant web-based application or micro-services system. I wrote about using Memcached as a distributed caching solution in my previous blog. In today’s blog, I am going to take a deep dive into Redis Cache as a distributed in-memory caching solution for .Net Core. … Read more

Deep dive into Default Interface methods in C# 8

In this blog, I am going to deep dive into Default Interface Methods in C# 8. This was released along with .Net Core 3.0 in September 2019. I have covered this topic briefly previously in my blog https://dotnetcorecentral.com/blog/c-8-my-top-5-favorite-features-which-i-absolutely-love/. But at that time I was not sure of the potential of this feature. Now, after going … Read more

Pattern matching in C#

We are using pattern matching in C# since the very beginning of C# through a combination of If/Else and Switch/Case statements. Pattern Matching is when we check an object’s member variable or property to have a full or partial match to a sequence. But these forms of pattern matching is very limited. Functional programming languages … Read more

Nullable reference types in C# 8

Nullable reference types is the default behavior of reference types in C# 7.3 and below versions. Well, what do I mean by that? When we declare reference types, pre-C# 8, it’s always nullable, meaning it can be assigned a null value. Hence we need to check it against null to avoid NullReferenceException. The newly introduced … Read more

Asynchronous Streams in C# 8/.Net Core 3.0

Asynchronous Streams is a new feature which is recently added to C# language in .NET Conference as a part of C# 8. This is one of the features C# 8 introduced, that I am very excited about. I introduced this feature when I discussed my top 5 features of C#8/.Net Core 3.0 in my previous … Read more

Top 5 new features of C# 8 (My take)

C# 8 was recently released with .Net Core 3.0. These two were released simultaneously in .Net Conf 2019. There are a lot of new features are released as a part of C# 8. Some of them are very interesting. Whereas some not so. C# 8 Top 5 Features Below are the 5 features, which stands … Read more

Microservice resilience – Circuit Breaker using polly in .Net Core

In a microservices environment, usually, multiple services talk to each other either. Some cases through HTTP calls, whereas in other cases using an event bus or queues. Circuit Breaker is an important pattern which helps to make microservices more resilient in these communication patterns. When services communicate with each other through HTTP calls, there is … Read more

Auto retry with Polly

Building distributed and micro-services is incomplete without the implementation of Circuit breaker and auto-retry. This post takes a stab on Auto retry with Poly. While building microservices and distributed systems, usually multiple services talk to each other. In some cases through reactive channels, like a stream or queue. For other cases through HTTP calls. In … Read more

NLog with Splunk in Docker

Logging is a crucial part of any application. In this blog, I will walk through using NLog and Splunk for application logging. Traditionally we used to use file-based logging. But with container-based application saving logs to a file is not a good strategy. In enterprise, there is the use of log collectors, which is provided … Read more