I\'m playing with ScriptCS (which is awesome!) but I couldn\'t figure out how to define an extension method within a .csx script file.
Take this e
Good news! It is now supported in C# script files (.csx)
But you have to declare an extension method on top level:
static string MyToLowerExtension(this string str)
{
return str.ToLower();
}
Do not declare it in a static class:
// this will not work!
public static class MyExtensionsClass
{
static string MyToLowerExtension(this string str)
{
return str.ToLower();
}
}