I am trying to write a method `GetDynamicConstructor<T>` which will return, essentially, a smart constructor for the given class. It will accept an array of strings as parameters and parse them as the appropriate type (given existing constructor data).

```
public void Init()
{
    DynamicConstructor<MyClass> ctor = GetDynamicConstructor<MyClass>();
    MyClass instance = ctor(new string[] { "123", "abc" }); // parse "123" as int
}

public delegate T DynamicConstructor<T>(string[] args);

public DynamicConstructor<T> GetDynamicConstructor<T>()
{
    ConstructorInfo originalCtor = typeof(T).GetConstructors().First();

    ParameterInfo[] paramsInfo = originalCtor.GetParameters();

    for (int i = 0; i < paramsInfo.Length; i++) {
        Type paramType = paramsInfo[i].ParameterType;

        // This is as far as I got :D
    }

    return null;
}

public class MyClass
{
    int n;
    string s;

    public MyClass(int n, string s)
    {
        this.n = n;
        this.s = s;
    }
}

```

What I want, basically, is to construct from `MyClass` a method which looks like this.

```
public MyClass Example(string[] args)
{
    return new MyClass(int.Parse(args[0]), args[1]);
}

```

There will only be basic types here so I can count on a `Parse` existing for the types I might run into.

How can I write the body of `GetDynamicConstructor<T>`?