-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows for better binding control (skipping private fields, etc)
Consolidates some CacheService, removes some usage of static CacheService Exposes ReflectionCacheOptions Better setup for Config on AutoFaker, Initialize added for external use (mostly just tests I imagine) Tests for ReflectionCacheOptions
- Loading branch information
Showing
20 changed files
with
195 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
using System; | ||
using Soenneker.Reflection.Cache; | ||
using Soenneker.Reflection.Cache.Options; | ||
|
||
namespace Soenneker.Utils.AutoBogus.Services; | ||
|
||
public class CacheService | ||
public sealed class CacheService | ||
{ | ||
internal ReflectionCache Cache => _cacheLazy.Value; | ||
|
||
private Lazy<ReflectionCache> _cacheLazy = new(() => new ReflectionCache(), true); | ||
private Lazy<ReflectionCache> _cacheLazy; | ||
|
||
private readonly ReflectionCacheOptions? _reflectionCacheOptions; | ||
|
||
public CacheService(ReflectionCacheOptions? reflectionCacheOptions = null) | ||
{ | ||
_reflectionCacheOptions = reflectionCacheOptions; | ||
_cacheLazy = new Lazy<ReflectionCache>(() => new ReflectionCache(_reflectionCacheOptions, true), true); | ||
} | ||
|
||
internal void ClearCache() | ||
{ | ||
_cacheLazy = new Lazy<ReflectionCache>(() => new ReflectionCache(), true); | ||
_cacheLazy = new Lazy<ReflectionCache>(() => new ReflectionCache(_reflectionCacheOptions, true), true); | ||
} | ||
} |
Oops, something went wrong.