与Ninject相同的内容.Get()bein Autofac?
Type handlerType = typeof(IMessageHandler<>);
Type[] typeArgs = { message.GetType() };
Type constructed = handlerType.MakeGenericType(typeArgs);
var handler = NinjectKernel.Get(constructed);
谢谢!
答案 0 :(得分:0)
您可以使用:
IContainer.Resolve(Type)