Пример #1
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     StartupIoC.ConfigureServices(services, Configuration);
     services.AddMvc(config => {
         config.Filters.Add(typeof(CustomExceptionFilter));
     });
 }
Пример #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

            AutoMapperConfig.RegisterMappings();
            StartupIoC.RegisterIoC(services, Configuration);
        }
Пример #3
0
        private void RegisterServices(IServiceCollection services)
        {
            services.AddScoped <IInsertPerson, InsertPerson>();
            services.AddScoped <IListPersonService, ListPersonService>();
            services.AddScoped <IEditPersonService, EditPersonService>();
            services.AddScoped <IDeletePersonService, DeletePersonService>();

            StartupIoC.RegisterServices(services);
        }
Пример #4
0
        private static void InitializeContainer(Container container)
        {
            StartupIoC.RegisterIoC(container);

            // Identity
            container.Register <ApplicationDbContext>(Lifestyle.Scoped);
            container.Register <IUserStore <ApplicationUser> >(() => new UserStore <ApplicationUser>(new ApplicationDbContext()), Lifestyle.Scoped);
            container.Register <ApplicationUserManager>(Lifestyle.Scoped);
            container.Register <ApplicationSignInManager>(Lifestyle.Scoped);
        }
Пример #5
0
 private static void InitializeContainer(Container container)
 {
     StartupIoC.RegisterIoC(container);
 }
Пример #6
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     StartupIoC.RegisterServices(services);
     services.AddControllers();
 }
Пример #7
0
 public void ConfigureServices(IServiceCollection services)
 {
     StartupIoC.Register(services);
 }