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?

Configure annotations in Swagger documentation for asp.net core api

.NET Core PROGRAMMINGSwashbuckle proposes some useful annotations to enrich documentation. This article describes how to enable annotations.PrerequisitesHow to configure swagger for asp.net core API?Getting StartedStep 1: Install below package:Swashbuckle.AspNetCore.AnnotationsStep 2: Add below code inside ConfigureServices function in startup.cs fileservices.AddSwaggerGen(c =>{c.EnableAnnotations();});CONFIGURESERVICES FUNCTION INSIDE STARTUP.CS FILEHow to add Operation AnnotationSwaggerOperation is a useful attribute where you can … Continue reading Configure annotations in Swagger documentation for asp.net core api

Swagger Configuration for .Net Core Api

.NET PROGRAMMINGThis article demonstrates how to attach swagger UI.PrerequisitesHow to create a .net core web API project in visual studio Link.Getting StartedStep 1: Install below two nuget packages :Swashbuckle.AspNetCore.SwaggerSwashbuckle.AspNetCore.AnnotationsStep 2: Add swagger.json configuration file in project root directory.Step 3: Add below code to startup.cs file, under ConfigureServices function (Refer Screenshot)services.AddSwaggerGen(c => { c.SwaggerDoc(“v1”, new Swashbuckle.AspNetCore.Swagger.Info { Title = … Continue reading Swagger Configuration for .Net Core Api