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.