Пример #1
0
        public void Init()
        {
            var container = new Container();

            var baseContainer = new BaseContainer(null, container);

            // Very Important
            MyServiceLocator.SetIoCContainer(baseContainer.Container);

            client = new SmtpClient
            {
                EnableSsl             = true,
                UseDefaultCredentials = false,
                DeliveryMethod        = SmtpDeliveryMethod.Network,

                //Gmail
                //Host = "smtp.gmail.com",
                //Port = 587,
                //Credentials = new NetworkCredential("*****@*****.**", "october2014"),

                //GoDaddysmtpout
                Host        = "relay-hosting.secureserver.net",
                Port        = 25,
                Credentials = new NetworkCredential("*****@*****.**", "Sw882@1"),
            };

            //Gmail
            //sender = "*****@*****.**";

            //GoDaddy
            sender = "*****@*****.**";
        }
Пример #2
0
        protected void Application_Start()
        {
            var container = new Container();

            // Simple Injector for MVC
            container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();
            container.RegisterMvcControllers(Assembly.GetExecutingAssembly());
            container.RegisterMvcIntegratedFilterProvider();

            // Simple Injector - other services
            var baseContainer = new BaseContainer(container: container);

            var resolver = new SimpleInjectorDependencyResolver(baseContainer.Container);

            DependencyResolver.SetResolver(resolver);

            // Very Important
            MyServiceLocator.SetIoCContainer(baseContainer.Container);
            MyMvcServiceLocator.SetIoCContainer(resolver);

            // Initialize MVC settings
            AppStartInitializer.Initialize();

            NHSessionManager.AddEntityAssemblies(new[] { "MultiTenancyFramework.Mvc" });
        }
Пример #3
0
        static void Init()
        {
            var baseContainer = new BaseContainer();

            MyServiceLocator.SetIoCContainer(baseContainer.Container);

            // Initialize MVC settings
            //AppStartInitializer.Initialize();

            NHSessionManager.AddEntityAssemblies(new[] { "ConsoleTests" });
            var fileRules = new Dictionary <string, Tuple <string, LoggingLevel> > {
                { "NHibernate.SQL", new Tuple <string, LoggingLevel>("${shortdate}_nh.log", LoggingLevel.Debug) }
            };

            LoggerConfigurationManager.ConfigureNLog(true, fileRules);
        }