@@ -20,9 +20,9 @@ public LookupUtilityService(ILookupRepository lookupRepository)
2020 _lookupRepository = lookupRepository ;
2121 }
2222
23- public string GetValue ( string list , string key , string defaultValue )
23+ public string GetValue ( string list , string key , string defaultValue , TimeSpan maxAge = default ( TimeSpan ) )
2424 {
25- var dict = GetList ( list ) ;
25+ var dict = GetList ( list , maxAge ) ;
2626 string val ;
2727 if ( ! dict . TryGetValue ( key , out val ) )
2828 {
@@ -32,9 +32,9 @@ public string GetValue(string list, string key, string defaultValue)
3232 return val ;
3333 }
3434
35- public string GetValue ( string list , string key , bool throwIfNotExists = false , bool allowDefaults = false )
35+ public string GetValue ( string list , string key , bool throwIfNotExists = false , bool allowDefaults = false , TimeSpan maxAge = default ( TimeSpan ) )
3636 {
37- var dict = GetList ( list ) ;
37+ var dict = GetList ( list , maxAge ) ;
3838 string val ;
3939 if ( ! dict . TryGetValue ( key , out val ) )
4040 {
@@ -54,13 +54,13 @@ public string GetValue(string list, string key, bool throwIfNotExists = false, b
5454 return val ;
5555 }
5656
57- private Dictionary < string , string > GetList ( string list )
57+ private Dictionary < string , string > GetList ( string list , TimeSpan maxAge = default ( TimeSpan ) )
5858 {
5959 var dict = new Dictionary < string , string > ( ) ;
6060
6161 if ( ! _lookupValues . TryGetValue ( list , out dict ) )
6262 {
63- dict = _lookupRepository . LoadList ( list ) ;
63+ dict = _lookupRepository . LoadList ( list , maxAge ) ;
6464
6565 if ( dict == null )
6666 {
0 commit comments