Middleware in ASP.Net Core

Middleware in ASP.Net Core is software components that are assembled into the HTTP pipeline to handle requests and response. A middleware component can either choose to pass the request to the next component in the pipeline. Or it may choose to end the request. Middleware can perform tasks both before as well as after the … Read more

ASP.Net Core Authorization (Role-based and Policy-based Authorization)

In this blog, I am going to take a deep-dive into ASP.Net Core Authorization. Authorization is the process to find out what action a user can perform. In the case of a REST API, it can be the resources a user can access. Or a particular HTTP verb associated with a resource. For example, let … Read more

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