The following doesn\'t work, of course. Is there a possible way, which is pretty similar like this?
Type newObjectType = typeof(MyClass); var newObject = gi
Maybe you can solve this using generics.
public void CastToMyType(object givenObject) where T : class { var newObject = givenObject as T; }