public static void Initialize(IAppSettingReader appSettingReader) { if (appSettingReader.CanApply) { _appSettingReader = appSettingReader; } }
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); } }
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); } }
static AppSettingFinder() { _appSettingReader = new DefaultAppSettingReader(); }
public UserTokenRepository(BrandHubDbContext context, IAppSettingReader appSettingReader) : base(context) { _appSettingReader = appSettingReader; TokenDurationInMinutes = _appSettingReader.GetValue <int>(AuthenticationConstants.TokenDurationKey, 30); }
public HumanResourcesService(IEmployeeDA employeeDA, IPersonPhoneDA phoneDA, IAppSettingReader appReader) : base(appReader) { EmployeeDA = employeeDA; PhoneDA = phoneDA; }