摘要: 使用代码注册组件:public static void ContainerCode(){ IUnityContainer container = new UnityContainer(); container.RegisterType<IClass, MyClass>(); //另一种注册方法,不过没有RegisterType<>()方法来的方便 //container.RegisterType(typeof(IClass), typeof(MyClass)); IClass classInfo = container.Resolve<IClass>(); 阅读全文
posted @ 2011-07-21 13:33 QooNet 阅读(1031) 评论(2) 推荐(0) 编辑