Skip to content

Commit

Permalink
Use Lazy overload based on framework version
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndon-gabriel committed Dec 16, 2024
1 parent 112065f commit edd8c76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Medidata.MAuth.Core/MAuthAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ public MAuthAuthenticator(MAuthOptionsBase options, ILogger logger, HttpClient h
_cache = cacheService ?? new MemoryCacheService(new MemoryCache(new MemoryCacheOptions()));
_options = options;
_logger = logger;
#if NET6_0_OR_GREATER
_lazyHttpClient = new Lazy<HttpClient>(httpClient);
#else
_lazyHttpClient = new Lazy<HttpClient>(() => httpClient);
#endif

_dateTimeOffsetWrapper = options.DateTimeOffsetWrapper;
}

Expand Down

0 comments on commit edd8c76

Please sign in to comment.