I try to understand an extension method similar to this code
var p = new Person("Tim");   
p.LastName = "Meier"; 
// reader.Get<bool>("IsDerivat");
var IsOlivia = p.Get<bool>("Olivia");   
This is my code inside RoslynPad:
public static class PersonExtensions
{
    public static T Get<T>(this Person person, string name)
    {
        return (T)person.NewFirstName(name);
    }
}
public class Person
{    
    public Person(string firstName)
    {
        this.FirstName = firstName;
    }
    public string FirstName {get; private set;}
    public string LastName {get; set;}
    public object NewFirstName(string name)
    {
        this.FirstName = name;
        return (object) this.FirstName;
    }        
}    
But i get this error
error CS1109: Extension methods must be defined in a top level static class; PersonExtensions is a nested class
I found this question extension-methods-must-be-defined-in-a-top-level-static-class- and the answers are good.
Adding a namespace Foo returns 
error CS7021: Cannot declare namespace in script code
It seems that roslynpad adds stuff behind the scene. So how can i make sure that my extension method is defined in a top-level static class?
 
     
    