Skip to content

Applies to

net11.0, net11.0-maccatalyst27.2, net11.0-android37.0, net11.0-windows10.0.19041, net11.0-macos27.2, net11.0-ios27.2, net10.0, net10.0-macos26.0, net10.0-android36.0, net10.0-maccatalyst26.0, net10.0-ios26.0, net10.0-windows10.0.19041, net48, net471, net47, net472, net481

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 (opens in a new tab)

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

Parameters

NameTypeDescription
classNamestring (opens in a new tab)Name 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 (opens in a new tab)

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
classNamestring (opens in a new tab)Name of the class — used as the settings key prefix.
userAccountResolverFunc (opens in a new tab)Delegate that returns the UserAccount cache, or throws when unavailable.
localMachineResolverFunc (opens in a new tab)Delegate that returns the LocalMachine cache, or throws when unavailable.
inMemoryResolverFunc (opens in a new tab)Delegate that returns the InMemory cache, or throws when unavailable.