Пример #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="config">配置信息</param>
 protected DataAccessBase(DataAccessConfig config)
 {
     DbContext = config.IsConnectionStringName
         ? new DbContext().ConnectionStringName(config.Text, config.DbProvider)
         : new DbContext().ConnectionString(config.Text, config.DbProvider);
     DbContext.CommandTimeout(config.CommandTimeOut < 1 ? TimeOut : config.CommandTimeOut);
 }
Пример #2
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="cfg">データアクセス定義情報</param>
        /// <param name="logger">ログ出力モジュール</param>
        public ThreadManeger(DataAccessConfig cfg = null, AppLogger logger = null)
        {
            //if (cfg != null)
            //{
            //	this.daccfg = cfg;
            //}
            if (logger != null)
            {
                appLog = logger;
            }
            else
            {
                appLog = AppLogger.Instance;
            }
            //一つ前のスタックを取得
            StackFrame callerFrame = new StackFrame(1);

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = callerFrame.GetMethod().ReflectedType.Name;
            }
            this.appLog.Debug("<TM> ThreadManeger loaded. from {0}.{1}", Name, callerFrame.GetMethod().Name);
            this.OnReceived += new MessageReceiveHandler(OnMesasageRecived);
            // 電源状態の変化イベントを登録する
            Microsoft.Win32.SystemEvents.PowerModeChanged += new Microsoft.Win32.PowerModeChangedEventHandler(SystemEvents_PowerModeChanged);
        }
Пример #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            CoreConfig.Setup(services, Configuration);

            DataAccessConfig.Setup(services, Configuration);

            MapperConfig.Setup();

            // Add framework services.
            services.AddMvc();
        }