Interface IAkavacheBuilder
- Namespace
- Akavache
- Assembly
- Akavache.dll
Interface for building and configuring BlobCache instances.
public interface IAkavacheBuilder : IAkavacheInstance
- Inherited Members
- Extension Methods
Properties
FileLocationOption
Gets the file location option.
FileLocationOption FileLocationOption { get; }
Property Value
- FileLocationOption
The file location option.
Methods
Build()
Builds the configuration and returns the configured Akavache instance.
IAkavacheInstance Build()
Returns
- IAkavacheInstance
The configured Akavache instance ready for use.
UseForcedDateTimeKind(DateTimeKind)
Sets the forced DateTime kind for serialization operations.
IAkavacheBuilder UseForcedDateTimeKind(DateTimeKind kind)
Parameters
kindDateTimeKindThe DateTime kind to use for all DateTime serialization.
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
WithApplicationName(string?)
Sets the application name for cache directory paths.
IAkavacheBuilder WithApplicationName(string? applicationName)
Parameters
applicationNamestringThe application name.
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
WithInMemory(IBlobCache)
Sets the InMemory cache instance.
IAkavacheBuilder WithInMemory(IBlobCache cache)
Parameters
cacheIBlobCacheThe cache instance to use for InMemory operations.
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
WithInMemoryDefaults()
Configures default in-memory caches for all cache types. Uses the appropriate InMemoryBlobCache based on the configured serializer.
IAkavacheBuilder WithInMemoryDefaults()
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
WithLegacyFileLocation()
Configures the builder to use legacy file locations for cache directories. This is required when migrating from V10 to V11 so that V11 can find and read the existing V10 database files.
IAkavacheBuilder WithLegacyFileLocation()
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
WithLocalMachine(IBlobCache)
Sets the LocalMachine cache instance.
IAkavacheBuilder WithLocalMachine(IBlobCache cache)
Parameters
cacheIBlobCacheThe cache instance to use for LocalMachine operations.
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
WithSecure(ISecureBlobCache)
Sets the Secure cache instance.
IAkavacheBuilder WithSecure(ISecureBlobCache cache)
Parameters
cacheISecureBlobCacheThe secure cache instance to use for Secure operations.
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
WithSerializer<T>()
Configures the serializer to use for cache operations.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
IAkavacheBuilder WithSerializer<T>() where T : ISerializer, new()
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
Type Parameters
TThe type of serializer to configure.
WithSerializer<T>(Func<T>)
Configures the serializer to use for cache operations with a custom factory function.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
IAkavacheBuilder WithSerializer<T>(Func<T> configure) where T : ISerializer
Parameters
configureFunc<T>A function that creates and configures the serializer instance.
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.
Type Parameters
TThe type of serializer to configure.
WithUserAccount(IBlobCache)
Sets the UserAccount cache instance.
IAkavacheBuilder WithUserAccount(IBlobCache cache)
Parameters
cacheIBlobCacheThe cache instance to use for UserAccount operations.
Returns
- IAkavacheBuilder
The builder instance for fluent configuration.