1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| <?xml version="1.0" encoding="utf-8" ?>
| <configuration>
| <configSections>
| <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,
| Microsoft.Practices.Unity.Configuration" />
| </configSections>
| <unity>
| <containers>
| <container name="MyContainer">
| <types>
| <!--type为对象的名称,mapTo为注入对象的名称 写法为用逗号隔开两部分,一是类的全部,包括命名空间,二是程序集名称-->
| <register type="UserInfo.IUser,UserInfo" mapTo="UserInfo.UserExp,UserInfo">
| <lifetime type="singleton" />
| </register>
| </types>
| </container>
| </containers>
| </unity>
| <startup>
| <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
| </startup>
| </configuration>
|
|