コード例 #1
0
 public static void Initialize(IAppSettingReader appSettingReader)
 {
     if (appSettingReader.CanApply)
     {
         _appSettingReader = appSettingReader;
     }
 }
コード例 #2
0
        protected BaseService(IAppSettingReader reader)
        {
            // Get value from app settings
            string dataAccessMethod = reader.GetAppSetting("DataAccessMethod");

            // Convert to enum
            try
            {
                DataAccessMethod = dataAccessMethod.ToEnum <DataAccessMethodEnum>();
            }
            catch (Exception e)
            {
                throw new Exception("Data access method configured incorrectly in config.", e);
            }
        }
コード例 #3
0
        protected BaseService(IAppSettingReader reader)
        {
            // Get value from app settings
            string dataAccessMethod = reader.GetAppSetting("DataAccessMethod");

            // Convert to enum
            try
            {
                DataAccessMethod = dataAccessMethod.ToEnum<DataAccessMethodEnum>();
            }
            catch(Exception e)
            {
                throw new Exception("Data access method configured incorrectly in config.", e);
            }
        }
コード例 #4
0
 static AppSettingFinder()
 {
     _appSettingReader = new DefaultAppSettingReader();
 }
コード例 #5
0
 public UserTokenRepository(BrandHubDbContext context, IAppSettingReader appSettingReader) : base(context)
 {
     _appSettingReader      = appSettingReader;
     TokenDurationInMinutes = _appSettingReader.GetValue <int>(AuthenticationConstants.TokenDurationKey, 30);
 }
コード例 #6
0
 public HumanResourcesService(IEmployeeDA employeeDA, IPersonPhoneDA phoneDA, IAppSettingReader appReader) : base(appReader)
 {
     EmployeeDA = employeeDA;
     PhoneDA    = phoneDA;
 }
コード例 #7
0
 public HumanResourcesService(IEmployeeDA employeeDA, IPersonPhoneDA phoneDA, IAppSettingReader appReader) : base(appReader)
 {
     EmployeeDA = employeeDA;
     PhoneDA = phoneDA;
 }