UnityContainer configured in web.config

我怕爱的太早我们不能终老 提交于 2019-12-05 21:04:26

Take a look at my tutorial

http://netpl.blogspot.com/2011/11/unity-application-block-is-lightweight.html

There's an example XML configuration:

<?xml version="1.0" encoding="utf-8" ?>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">       
<container>        
<register type="ConsoleApplication30.Logic.ICustomService, ConsoleApplication30"                  
          mapTo="ConsoleApplication30.Logic.CustomServiceImpl, ConsoleApplication30" />    
</container></unity>

and you load it with

IUnityContainer container = new UnityContainer();                
container.LoadConfiguration();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!