Created
May 14, 2018 21:19
-
-
Save inwenis/36626ce8260d6d5e2cc78ade15a5743c to your computer and use it in GitHub Desktop.
what is this interface for?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal interface IAppSettingsReader | |
{ | |
GasPeriodDto GetGasPeriodFromConfig(); | |
bool IsHourly(); | |
BalanceOverviewFilterDto GetFiltersFromConfig(); | |
} | |
class AppSettingsReader : IAppSettingsReader | |
{ | |
public GasPeriodDto GetGasPeriodFromConfig() | |
{ | |
int gasPeriod; | |
int.TryParse(ConfigurationManager.AppSettings["GasPeriod"], out gasPeriod); | |
return GasPeriodDto.All.First(p => p.Id == gasPeriod); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment