Ejemplo n.º 1
0
Archivo: Orm.cs Proyecto: darakeon/dfm
        public static void Config(IApplicationBuilder app, IHostApplicationLifetime life)
        {
            try
            {
                SessionFactoryManager.Initialize <UserMap, User>(Cfg.DB);

                app.Use <Orm>(async(context, next) =>
                {
                    if (context.IsAsset())
                    {
                        return;
                    }

                    SessionManager.Init(
                        () => Session.GetKey(() => context)
                        );

                    await next();

                    SessionManager.Close();
                });

                life.ApplicationStopping.Register(SessionFactoryManager.End);
            }
            catch (Exception e)
            {
                e.TryLogHandled("Error on initialize DB");
            }
        }
Ejemplo n.º 2
0
        private static void sessionFactory(Action action)
        {
            SessionFactoryManager.Initialize <UserMap, User>(Cfg.DB);

            try
            {
                action();
            }
            finally
            {
                SessionFactoryManager.End();
            }
        }
Ejemplo n.º 3
0
        public static void Start()
        {
            Cfg.Init();

            setLogName();

            setRepositories();

            log("General", "BeforeTestRun");

            TZ.Init(false);

            ControlMap.IsTest = true;

            SessionFactoryManager.Initialize <UserMap, User>(Cfg.DB);
            SessionManager.Init(getTicketKey);

            service = new ServiceAccess(getTicket, getSite);

            PlainText.Initialize(runPath);
        }