Skip to main content

Posts

Showing posts from March 8, 2017

Extension Method in C#

Introduction I would like to share how to create Extension methods in C# and why we need to have them in C#. First we will discuss the problem and then will rectify the problem using an Extension method. Understanding the problem 1. Add a Class library as per the following screen. We created a Calculator library. 2. Add the calculator class as per the screen below. Code   public   class   Calculator {      public   int  Add( int  x,  int  y)     {          return  x + y;     }      public   int  Subtract( int  x,  int  y)     {          return  x - y;     }      public   int  Divide( int  x,  int  y)     {    ...

Contact Form

Name

Email *

Message *