27 lines
599 B
C#
27 lines
599 B
C#
using Autofac;
|
|
using IoC.implement;
|
|
using IoC.inerface;
|
|
|
|
namespace IoC
|
|
{
|
|
public class Container
|
|
{
|
|
/// <summary>
|
|
/// 仲介公司
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static IContainer MiddleCompany()
|
|
{
|
|
ContainerBuilder builder = new ContainerBuilder();
|
|
|
|
//在仲介公司裡寫需求人申請單
|
|
builder.RegisterType<MineWithMiddle>();
|
|
//小明所需打掃阿姨需求
|
|
builder.RegisterType<Aunt>().As<ISwapable>();
|
|
|
|
return builder.Build();
|
|
}
|
|
|
|
}
|
|
}
|