In C# we have extension methods - special static methods declared separately, but used as regular methods, pretty much like prototype methods in javascript.
public class MyClass {}
// declaration
public static class Ex
{
public static string toJson<T>(this T obj) { /* serialize to json */ }
}
...
//usage
var myobj = new MyClass();
myobj.toJson();
no subject