示例#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);
 }