Why should I inject IHttpContextAccessor as a Singleton

According to comments associated with an issue raised on GitHub https://github.com/aspnet/Hosting/issues/793#issuecomment-224828588 In that sample, you are registering it as a singleton. Shouldn’t it be a scoped instance? It’s fine being a singleton because the backing store is async local. Which got a later reply https://github.com/aspnet/Hosting/issues/793#issuecomment-224924030 Actually if you register it as a Transient on .NET Core then it […]

Cache Implementations in C# .NET

One of the most commonly used patterns in software development is Caching. It’s a simple, but a very effective concept. The idea is to reuse operation results. When performing a heavy operation, we will save the result in our cache container. The next time that we need that result, we will pull it from the cache container, instead of performing […]

Series: Writing High-Performance C# and .NET Code

I am interested in reading this series on this link This series explores modern C# and .NET/.NET Core techniques and features which support writing more performance, low allocation code. Posts in this series: Part 1: Motivations for Writing High-Performance C# Code Part 2: Introduction to Benchmarking C# Code with Benchmark .NET Part 3: An Introduction to Optimising Code […]

Building Secure ASP.NET MVC Web Applications

Introduction Building secure distributed Web applications is challenging. There’s nothing more exciting than creating a fancy web application. What isn’t as exciting, however, is the security risk involved. When it comes to web application development in today’s increasingly digitized, mobilized, Internet-of-Things world, security measures can no longer be the afterthoughts they once were. With distributed applications, you have a lot […]

Deploy dotnet core on ubuntu

# Add Microsoft keys wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb # Removing Apache2 and install Nginx instead sudo apt-get remove –purge apache2 apache2-utils sudo rm -rf /etc/apache2 sudo add-apt-repository ppa:nginx/stable # Start installing sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install python-software-properties sudo apt-get install nginx sudo apt-get install dotnet-sdk-2.2 # Configure Nginx sudo service nginx […]

Install MS SQL Server on ubuntu

sudo apt-get install -y software-properties-common wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add – sudo add-apt-repository “$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)” sudo apt-get update sudo apt-get install -y mssql-server sudo /opt/mssql/bin/mssql-conf setup For More info : https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017