Exemplo n.º 1
0
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType <CourseCategoryService>().As <ICourseCategoryService>().InstancePerLifetimeScope();
            builder.RegisterType <CourseService>().As <ICourseService>().InstancePerLifetimeScope();

            builder.Register(a => AcademyContextFactory.Create(_connectionString)).InstancePerLifetimeScope();
        }
Exemplo n.º 2
0
        private static AcademyDbContext GetDbConstructor()
        {
            var factory = new AcademyContextFactory();

            return(factory.CreateDbContext(null));
        }