Visual studio and .NET tip 14:- Implement interfaces with right clicks

By Shivprasad Koirala

In this Tip and tricks we will see how to implement interfaces with right click.

Many times we come across scenarios where we have lengthy interfaces with lot of properties, methods and functions.Implementing these functions to classes manually is a pain. In c# it just adds more pain as its case sensitive.

interface ICustomer
{
string CustomerCode { set; get; }
string CustomerName { set; get; }
int CustomerId { set; get; }
string Address { set; get; }
string Phone { set; get; }
string PanNumber { set; get; }
string Idumber { set; get; }
}



Good news, right click, implement interface and start coding as shown in the below figure.



Related FAQs

Many times as a developer you come across functions with lots of input parameters as shown in the below code snippets. In real projects the input parameters would be much higher as compared to the below code snippets. Some times for various reasons you want to shuffle them, reorder them or remove some of them.
Many times due to project pressure and lazy attitude you violate encapsulation and create public variables for classes as shown below. Even though your inner heart knows that the best practice is to create set and get property function but your lazy attitude overrules it.
We all know exceptions get propagated from the last caller to the main caller. For instance let’s say from your static void main method you are calling “SomeMethod” and he in turn is calling “SomeMethod1”.
While debugging you often want to skip debugging on certain lines of code. For instance in the below code you have set the debug point to the first line, you would like to skip the in between lines and jump directly to “console.writeline” step.
In big project you have 100’s of classes and each of those classes can have lots of properties.
Many times while debugging we would like to:- • See the debugged value after debugging has finished. • Enter comments while debugging and see these comments later. • Pin the debugger so that we can see the values while debugging.
Visual studio and .NET tip 14:- Implement interfaces with right clicks  (1678 Views)