예제 #1
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     MappingConfig.Configure();
 }
예제 #2
0
        private static IContainer Initialize()
        {
            var container = new Container(new DefaultRegistry());

            MappingConfig.Configure(container);
            return(container);
        }
예제 #3
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            AttributeRoutingHttpConfig.Start();
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            MappingConfig.Configure();
        }
예제 #4
0
        public Bootstrapper()
        {
            var environment = EnvironmentUtility.GetCommandLineVariable("APP_ENVIRONMENT");

            _configuration = new ConfigurationBuilder()
                             .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                             .AddJsonFile($"appsettings.{environment}.json", optional: true, reloadOnChange: true)
                             .Build();

            var locale = _configuration.GetValue <string>("AppLocale");

            EnvironmentUtility.SetCurrentLocale(locale);

            MappingConfig.Configure();
        }
예제 #5
0
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.RegisterInstance(new SatteliteDBContext()).As <SatteliteDBContext>().SingleInstance();

            //builder.RegisterType<GenericRepository<Entity>>().AsImplementedInterfaces();
            builder.RegisterType <CategoryRepository>().AsImplementedInterfaces();
            builder.RegisterType <NewsRepository>().AsImplementedInterfaces();
            builder.RegisterType <UserRepository>().AsImplementedInterfaces();
            builder.RegisterType <RoleRepository>().AsImplementedInterfaces();
            builder.RegisterType <ProjectRepository>().AsImplementedInterfaces();
            builder.RegisterType <ProjectRoleRepository>().AsImplementedInterfaces();

            //Wrapped repositories
            builder.RegisterType <UserEditingPersistence>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <RoleCreatingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <RoleDeletingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <RoleEditingPersistence>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <CategoryCreatingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <CategoryDeletingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <CategoryEditingPersistence>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <NewsCreatingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <NewsDeletingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <NewsEditingPersistence>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <ProjectCreatingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <ProjectDeletingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <ProjectEditingPersistence>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <ExConfigurationManager>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <MediaItemStorage>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <Encryptor>().AsImplementedInterfaces().SingleInstance();
            MappingConfig.Configure();

            //Database.SetInitializer(new CreateDatabaseIfNotExists<SatteliteDBContext>());
            //Database.SetInitializer(new SeedInitializer());
        }
예제 #6
0
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.RegisterInstance(new MyDbContext("DefaultDb")).As <MyDbContext>().SingleInstance();

            builder.RegisterType <CategoryRepository>().AsImplementedInterfaces();
            builder.RegisterType <ItemRepository>().AsImplementedInterfaces();
            builder.RegisterType <UserRepository>().AsImplementedInterfaces();

            builder.RegisterType <ItemCreatingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <ItemDeletingPersistence>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <ItemEditingPersistence>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <ExConfigurationManager>().AsImplementedInterfaces().SingleInstance();
            builder.RegisterType <MediaItemStorage>().AsImplementedInterfaces().SingleInstance();

            builder.RegisterType <Encryptor>().AsImplementedInterfaces().SingleInstance();

            MappingConfig.Configure();
        }
예제 #7
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            services.AddDbContext <DataContext>(options =>
                                                options.UseSqlServer(Configuration.GetConnectionString("WFF")));

            services.AddDistributedMemoryCache();
            services.AddSession(options =>
            {
                options.IdleTimeout     = TimeSpan.FromMinutes(10);
                options.Cookie.HttpOnly = true;
            });
            services.AddHttpContextAccessor();
            services.AddMemoryCache();

            services.Configure <Configuration>(Configuration.GetSection("MyConfig"));

            services.AddScoped <ILoginService, LoginService>();
            services.AddScoped <IHeaderViewModel, HeaderViewModel>();
            services.AddScoped <IADUserViewModel, ADUserViewModel>();
            services.AddScoped <IActionViewModel, ActionViewModel>();
            services.AddScoped <IUserUtil, UserUtil>();
            services.AddScoped <IBitacora, Bitacora>();
            services.AddScoped <IUserProfile, UserProfile>();
            services.AddScoped <IDesktopViewModel, DesktopViewModel>();
            services.AddScoped <IFormRequestService, FormRequestService>();
            services.AddScoped <IEmailService, EmailService>();
            services.AddScoped <IHistoryService, HistoryService>();
            services.AddScoped <IAttachmentService, AttachmentService>();
            services.AddScoped <IFormXmlService, FormXmlService>();
            services.AddScoped <IFormRequestViewModel, FormRequestViewModel>();
            services.AddScoped <IFormsBoardViewModel, FormsBoardViewModel>();
            services.AddScoped <IFormRequest, FormRequest>();

            MappingConfig.Configure();
        }
예제 #8
0
 private static void ConfigureMappings()
 {
     MappingConfig.Configure();
 }