Пример #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);
        }
 /// <summary>
 /// 依赖注册
 /// </summary>
 /// <param name="container">依赖容器</param>
 protected abstract void Register(IDenpendencyContainer container);
 public void Init(DependencyRegister dr)
 {
     Container = dr.Container;
     dr.Register();
 }