Blog

Filter posts by Category Or Tag of the Blog section!

Technical Skills, Software Development, Real World Solutions, Enterprise Applications.
Analyzers in .net core are for informing the developers about potential issues in the code. The analyzers have been built into the C# compiler and every framework like asp.net core could have its own ...

Wednesday, 26 October 2022
In my previous post about running worker service in windows as a windows service, I coveted the required operations from converting to hosting. But in the case that reading some details from JSON file...

Monday, 29 November 2021
Worker Service in dotnet lets you create a long-running service in a CMD environment by using  BackgroundService, which is an implementation of IHostedService. Rather than that it provinces the c...

Wednesday, 24 November 2021
Both middleware and filter in asp.net core are used for handling incoming requests. Middleware is used for the entire request pipeline but filters are used for a specific requests. One of the biggest ...

Wednesday, 29 September 2021
In order to generalize a mapping class of entity framework core, there is an interface with the following definition:     public interface IEntityTypeConfiguration<TEntity>...

Saturday, 15 May 2021
After moving my website to dotnet core, in order to make the admin panel more secure, I decided to filter the admin panel and restrict it to my static IPs. there are lots of ways to do that, I persona...

Sunday, 21 February 2021
C# 9 came with some cool features. One of them was the init keyword. Simply, you can initialize a property or the indexer element only during the construction. Take a look at the following property de...

Monday, 14 December 2020
In order to get the base URL in controller scope, you simply get via Request:   public class HomeController : ControllerBase    {       &n...

Sunday, 22 November 2020
In asp.net core project templates, you can find something name Worker. It’s a service-based project which has the capability of being converted to windows service. After creating the project, yo...

Saturday, 11 April 2020
Recently I was tackling a problem with localization in asp.net core. I wanted to get the culture in every request from API and respond based on the requested culture. So I created the following middle...

Friday, 07 February 2020
I'm already working on a project and a challenging decision has been made to use asp.net core razor pages. Based on Microsoft definition:" ASP.NET Core Razor Pages is a page-focused framework...

Sunday, 01 December 2019
In C#, you can create private constructors. It is used in a class that contains static members only. You can NOT instantiate from a class that has a private constructor with the same parameters. The m...

Monday, 18 February 2019
In a console application in .Net Core, you don’t have the appsettings.json file. In order to add this file, add a JSON file with the same name (or any name that you want) and make the following ...

Thursday, 17 January 2019
I just faced a problem in asp.net core which was specifying the bounded port. There is an extension in WebHostBuilder named  UseUrls() to specify that:    public class Prog...

Tuesday, 08 January 2019
Tackling with different problems, using multiple programming languages and multiple database types in large scale applications, is not something strange, and based on needs there could be more th...

Monday, 07 January 2019
I heard about Scala programing language a few days ago; its advantages and power. After reading a few hours about the features of this cool language, I decided to write a short post about to introduce...

Monday, 07 January 2019
The use of Linux containers to deploy applications is called containerization. A container runs natively on Linux and shares the kernel of the host machine with other cont...

Thursday, 22 November 2018
There are a few ways to handle exceptions in asp.net core 2.1. using Middleware is so straightforward, and it handles the application exceptions as well as exceptions from filters and you can have ful...

Thursday, 08 November 2018