mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-03 00:00:58 +08:00
16 lines
497 B
C#
16 lines
497 B
C#
|
|
using System;
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace CC.Yi.API
|
|||
|
|
{
|
|||
|
|
public class Startup
|
|||
|
|
{
|
|||
|
|
//动态 面向AOP思想的依赖注入 Autofac
|
|||
|
|
public void ConfigureContainer(ContainerBuilder builder)
|
|||
|
|
{
|
|||
|
|
builder.RegisterType(typeof(CustomAutofacAop));
|
|||
|
|
builder.RegisterGeneric(typeof(BaseDal<>)).As(typeof(IBaseDal<>));
|
|||
|
|
builder.RegisterType<studentBll>().As<IstudentBll>().EnableInterfaceInterceptors();//表示注入前后要执行Castle,AOP
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|