Posts

Showing posts from 2019

What is the need of method overriding ???

When we need to extend the Parents class method's behavior with some modifications. This is the situation where we inherit the class and override the methods which are required as per our business requirement. namespace testApp {     abstract class Employee     {         public int EmployeeID { get ; set ; }         public String EmployeeName { get ; set ; }         public double BasicSalary { get ; set ; }         abstract public void CalculateSalary();     }     class PermanentEmployee : Employee     {         public override void CalculateSalary()         {             double HRA = 20 * Basic...

How to set Swagger as default start page for Web API application

How to set Swagger as default start page for Web API application Open WebApiConfig.cs class of your Web API solution Add the below-highlighted code. This uses the RedirectHandler class of the Swashbuckle assembly. using Swashbuckle.Application; using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; namespace  Web.API {     public static class WebApiConfig     {         public static void Register( HttpConfiguration config)         {             // Web API configuration and services             // Web API routes             config.MapHttpAttributeRoutes();             ...