コード例 #1
0
        protected override void Register(IDenpendencyContainer container)
        {
            container.AddComponent<IA, A>(string.Empty, ComponentServiceLifetime.LifetimeScope);

            container.AddComponent<IDataBaseContext, TestContext>(string.Empty, ComponentServiceLifetime.LifetimeScope);
            container.AddComponent<IStudentRepository, StudentRepository>("", ComponentServiceLifetime.LifetimeScope);
            container.AddComponent<ITecherRepository, TecherRepository>("", ComponentServiceLifetime.LifetimeScope);
        }
コード例 #2
0
 /// <summary>
 /// 依赖注册
 /// </summary>
 /// <param name="container">依赖容器</param>
 protected abstract void Register(IDenpendencyContainer container);
コード例 #3
0
 public void Init(DependencyRegister dr)
 {
     Container = dr.Container;
     dr.Register();
 }