Exemplo n.º 1
0
 public ServerConfiguration GetCurrentServerConfiguration()
 {
     using (var ctx = new MhorMailContext())
     {
         return(ctx.ServerConfigurations.First());
     }
 }
Exemplo n.º 2
0
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
            var builder = new ContainerBuilder();

            builder.RegisterControllers(typeof(Startup).Assembly);
            DependencyConfig.RegisterDependencies(builder);
            var container = builder.Build();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
            app.UseAutofacMiddleware(container);
            app.UseAutofacMvc();
            Database.SetInitializer(new MhorMailInitializer());
            using (var ctx = new MhorMailContext())
            {
                ctx.Database.Initialize(false);
            }
        }