Example #1
0
        public static void RegisterDatatabaseRepositories()
        {
            var container = RepositoryResolver.GetContainer();

            // 2. Configure the container (register)
            // See below for more configuration examples
            container.Register(typeof(IINGRepository), typeof(INGRepository), Lifestyle.Transient);
            container.Register(typeof(IASNRepository), typeof(ASNRepository), Lifestyle.Transient);
            container.Register(typeof(ICustomImportRepository), typeof(CustomImportRepository), Lifestyle.Transient);
            container.Register(typeof(ICategoriesStatisticsRepository), typeof(CategoriesStatisticsRepository), Lifestyle.Transient);
        }
        public override void Start(Action initializeUserRepository)
        {
            base.Start(initializeUserRepository);
            // 1. Create a new Simple Injector container
            var container = RepositoryResolver.GetContainer();

            // 2. Configure the container (register)
            // See below for more configuration examples
            container.Register <ITransactionRepository, EFTransactionRepository>(UseLifestyle);
            container.Register <IRelationRepository, EFRelationRepository>(UseLifestyle);
            container.Register <ICategoryRepository, EFCategoryRepository>(UseLifestyle);
            container.Register <IMainCategoryRepository, EFMainCategoryRepository>(UseLifestyle);
        }