Skip to content

Applies to

net10.0, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net10.0-android36.0, net10.0-ios26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net9.0, net9.0-windows10.0.19041, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net481, net462

Overloads

  • 1. protected SettingsBase(string className)
  • 2. protected SettingsBase(string className, Func<IBlobCache> userAccountResolver, Func<IBlobCache> localMachineResolver, Func<IBlobCache> inMemoryResolver)

1. Overload

protected SettingsBase(string className)

View source

Summary: Initializes a new instance of the SettingsBase class that resolves its backing cache from the ambient CacheDatabase.

Parameters

NameTypeDescription
classNamestringName of the class — used as the settings key prefix.

2. Overload

protected SettingsBase(string className, Func<IBlobCache> userAccountResolver, Func<IBlobCache> localMachineResolver, Func<IBlobCache> inMemoryResolver)

View source

Summary: Initializes a new instance of the SettingsBase class with explicit ambient-cache resolvers. The resolver delegates are used by TryGetFromCacheDatabase when the explicit registry does not contain an entry for className; each resolver is wrapped in a try/catch so an unconfigured cache kind simply falls through to the next. This overload exists to make the class testable without touching the global CacheDatabase singleton.

Parameters

NameTypeDescription
classNamestringName of the class — used as the settings key prefix.
userAccountResolverFuncDelegate that returns the UserAccount cache, or throws when unavailable.
localMachineResolverFuncDelegate that returns the LocalMachine cache, or throws when unavailable.
inMemoryResolverFuncDelegate that returns the InMemory cache, or throws when unavailable.