Example #1
0
        private void InitializeIoC()
        {
            var container = new RegisterByContainer().Container;

            var unitOfWork = container.GetInstance <IUnitOfWork>();

            var typiconEntityService = container.With(unitOfWork).GetInstance <ITypiconEntityService>();

            GetTypiconEntityResponse response = typiconEntityService.GetTypiconEntity(1);// _unitOfWork.Repository<TypiconEntity>().Get(c => c.Name == "Типикон");

            typiconEntity = response.TypiconEntity;

            var bookStorage = new BookStorage(
                container.With(unitOfWork).GetInstance <IEvangelionContext>(),
                container.With(unitOfWork).GetInstance <IApostolContext>(),
                container.With(unitOfWork).GetInstance <IOldTestamentContext>(),
                container.With(unitOfWork).GetInstance <IPsalterContext>(),
                container.With(unitOfWork).GetInstance <IOktoikhContext>(),
                container.With(unitOfWork).GetInstance <ITheotokionAppContext>(),
                container.With(unitOfWork).GetInstance <IEasterContext>(),
                container.With(unitOfWork).GetInstance <IKatavasiaContext>());

            IRuleSerializerRoot serializerRoot = container.With(bookStorage).GetInstance <IRuleSerializerRoot>();

            settingsFactory = new CustomRuleSettingsFactory();

            scheduleService = container.With(settingsFactory).With(serializerRoot).GetInstance <IScheduleService>();
        }
Example #2
0
        private void InitializeIoC()
        {
            var container = new RegisterByContainer().Container;

            _unitOfWork = container.GetInstance <IUnitOfWork>();

            _typiconEntityService = container.With(_unitOfWork).GetInstance <ITypiconEntityService>();

            GetTypiconEntityResponse response = _typiconEntityService.GetTypiconEntity(1);// _unitOfWork.Repository<TypiconEntity>().Get(c => c.Name == "Типикон");

            _typiconEntity = response.TypiconEntity;

            _bookStorage = new BookStorage(
                container.With(_unitOfWork).GetInstance <IEvangelionContext>(),
                container.With(_unitOfWork).GetInstance <IApostolContext>(),
                container.With(_unitOfWork).GetInstance <IOldTestamentContext>(),
                container.With(_unitOfWork).GetInstance <IPsalterContext>(),
                container.With(_unitOfWork).GetInstance <IOktoikhContext>(),
                container.With(_unitOfWork).GetInstance <ITheotokionAppContext>(),
                container.With(_unitOfWork).GetInstance <IEasterContext>(),
                container.With(_unitOfWork).GetInstance <IKatavasiaContext>());

            //EasterStorage.Instance.EasterDays = _unitOfWork.Repository<EasterItem>().GetAll().ToList();

            IRuleSerializerRoot serializerRoot = container.With(_bookStorage).GetInstance <IRuleSerializerRoot>();
            var settingsFactory = container.GetInstance <IRuleHandlerSettingsFactory>();

            _scheduleService = container.With(settingsFactory).With(serializerRoot).GetInstance <IScheduleService>();

            _docxTemplateService = container.With(_bookStorage.Oktoikh).GetInstance <IDocxTemplateService>();
        }