public static void LoadMethod_Static()
{
// 1 - LoadMethod wraps method into a class definition, compiles it and returns loaded assembly
// 2 - GetStaticMethod returns first found static method as a duck-typed delegate that
// accepts 'params object[]' arguments
//
// Note: you can use GetStaticMethodWithArgs for higher precision method search: GetStaticMethodWithArgs("*.SayHello", typeof(string));
var sayHello = CSScript.LoadMethod(@"static void SayHello(string greeting)
{
Console.WriteLine(greeting);
}")
.GetStaticMethod();
sayHello("Hello World!");
}