Forum Discussion

sehajpalsinghj's avatar
9 years ago

add a method using C#

Hi, I am new to this domain.Is it possible to add a method to an item type using C sharp code? If so, could you give an example.

4 Replies

  • In C#, the extension method concept allows you to add new methods in the existing class or in the structure without modifying the source code of the original type and you do not require any kind of special permission from the original type and there is no need to re-compile the original type. Mygroundbiz

  • All you need to do is to pass your instance to the method with this keyword so that the method will act as a method of the passed class. You can add whatever functionality you would like to add by accessing the instance. Now you can access to these method as though you access the method of the class SealedClass.

    MyGroundBiz