Design Pattern – Adapter

C# CONCEPTSAccording to Gang of Four, the Adapter Pattern converts the interfaces of a class into interfaces that the client requires.In other words, the adapter design pattern helps incompatible interfaces work collectively.Photo by Brett Sayles from PexelsUse CaseLet's consider an example of two organizations merging; X organization is taking over Y, but while combining code, the … Continue reading Design Pattern – Adapter

Adding GraphQL wrapper over REST API

C# CONCEPTSHow to add GraphQL wrapper over existing REST API along with Swagger.Learning ObjectivesHow to add GraphQL wrapperHow to use the NSwag tool to generate codePrerequisitesRequire “HotChocolate.AspNetCore” from NuGet package.Require .Net 5 Framework.Visual Studio IDE.Understanding of .Net Web API project.Basic knowledge of Swagger UI.Getting StartedGraphQL allows you to ask for what you want in a single query, save … Continue reading Adding GraphQL wrapper over REST API

Add favicon — ASP.Net

C# CONCEPTS How to add favicons to your ASP.NET applications Photo by HalGatewood.com on Unsplash Learning Objectives Generate favicons for different devices online. Add favicon or shortcut icon on ASP.Net Website. Prerequisites Install latest visual studio community edition. Getting Started What is a favicon? The favicon, also identified as a shortcut icon, tiny icon, or website icon … Continue reading Add favicon — ASP.Net

Run SonarQube Locally — .Net

.NET CODE ANALYSISHow to run SonarQube locally for .Net solutionsThe article describes how to analyze C# code quality using the SonarQube command line.Photo by Jefferson Santos on UnsplashPrerequisitesDownload the SonarQube free Community EditionSonarQube scanners require version 8/11 of the JVM, and the SonarQube requires version 11Install PostgreSQL for demonstration, but it also supports MSSQL and Oracle databases.For the .Net … Continue reading Run SonarQube Locally — .Net

Elevated access for dotnet commands

Image by Arek Socha from PixabayFor best practices, software should have the least amount of privileges. However, some tools like performance monitoring require elevated admin permissions.The article describes the scenario for programming such software or applications in .Net Core.Install tool GloballyThe following instructions guide the way to run, install, or uninstall .Net Core tools that need to be executed … Continue reading Elevated access for dotnet commands

YARP- .Net Core Reverse Proxy

.NET CoreIt is a reverse proxy toolkit for developing secure proxy servers in .NET.Image by Mudassar Iqbal from PixabayYARP stands for “YARP: A Reverse Proxy” is a project to create a reverse proxy server.YARP fills into the ASP.NET pipeline for managing incoming requests and then has its sub-pipeline for implementing the steps to proxy the requests to … Continue reading YARP- .Net Core Reverse Proxy

.Net Core Startup Class Guide

C# CONCEPTSThe Startup class is a single place to configure services and the app's request pipeline.Image by 200 Degrees from PixabayThe Startup class explained as follows:It contains an optional Configure Services method to configure app services. A service is a reusable module that provides functionality.Need to register services in the Configure Services method and consumed throughout the … Continue reading .Net Core Startup Class Guide

Configuration Providers in .NET

C# CONCEPTSConfiguration in .NET is achievable with various configuration providers.There are different types of providers that rely on many configuration sources. The article details each of the configuration provider's variants and their corresponding sources.File configuration providerEnvironment variable configuration providerCommand-line configuration providerKey-per-file configuration providerMemory configuration providerWhy is the configuration required?Configuration in .NET is the capability to bind values … Continue reading Configuration Providers in .NET

How to configure NLog Framework?

.NET PROGRAMMINGThis article demonstrates how to add file logging using NLog Framework.Github ProjectStep 1: Create an empty .NET core web api project inside visual studio.Step 2: Install NLog.Web.AspNetCore from nuget managerStep 3: Add a configuration file into the project. For example, “nlog.config”Add the below code into the configuration for file logging. Path of the file is highlighted belowhttps://gist.github.com/ssukhpinder/54776c3e09b0f378303c52ce6854fbc0Step … Continue reading How to configure NLog Framework?