If the dependency container has a non-generic method, call that:
container.RegisterType(type, interfaceType);
If it doesn't have a non-generic method, and if you can modify the source, I'd strongly recommend providing one; it makes this kind of thing a lot easier. Typically, with a container like this your generic method will end up calling your non-generic one:
public void RegisterType(Type implType, Type ifaceType)
{
...
}
public void RegisterType<TImpl, TIface>() where TImpl : TIface
{
this.RegisterType(typeof(TImpl), typeof(TIface));
}
Otherwise you'll have to dynamically provide the generic parameters through reflection:
var methodInfo = container.GetType().GetMethod("RegisterType");
var actualMethod = methodInfo.MakeGenericMethod(type, interfaceType);
methodInfo.Invoke(container);
But this is neither efficient nor particular elegant.