Class AkavacheBuilderExtensions
- Namespace
- Akavache
- Assembly
- Akavache.dll
Provides extension methods for configuring Akavache cache database with Splat application builders.
- Inheritance
-
Akavache
Builder Extensions
Methods
GetIsolatedCacheDirectory(IAkavacheInstance, string)
Gets the isolated cache directory.
Parameters
builderIAkavacheInstance The builder.
cacheNamestringName of the cache. This will determine the file store to use. LocalMachine will use Machine Store For Assembly. UserAccount will use User Store For Assembly. Secure will use User Store For Assembly. SettingsCache will use User Store For Assembly. Any other value will use Machine Store For Assembly.
Returns
- string
The Isolated cache path.
Exceptions
- Argument
Null Exception builder.
- Argument
Exception Cache name cannot be null or empty. - cacheName or Application name cannot be null or empty. - ApplicationName.
GetLegacyCacheDirectory(IAkavacheInstance, string)
Gets the legacy cache directory.
Parameters
builderIAkavacheInstance The builder.
cacheNamestringName of the cache.
Returns
- string
The Legacy cache path.
Exceptions
- Argument
Null Exception builder.
- Argument
Exception Cache name cannot be null or empty. - cacheName or Application name cannot be null or empty. - ApplicationName.
WithAkavacheCacheDatabase<T>(IAppBuilder, Action<IAkavacheBuilder>, string?)
Initializes the CacheDatabase with a custom builder configuration for the specified application.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavacheCacheDatabase<T>(this IAppBuilder builder, Action<IAkavacheBuilder> configure, string? applicationName = null) where T : ISerializer, new()
Parameters
builderIAppBuilder The Splat application builder to configure.
configureAction<IAkavacheBuilder >An action to configure the Akavache builder settings.
applicationNamestringThe name of the application for cache directory paths.
Returns
- IApp
Builder The configured Splat application builder for method chaining.
Type Parameters
TThe type of serializer to use for cache operations.
Exceptions
- Argument
Null Exception Thrown when
builderis null.
WithAkavacheCacheDatabase<T>(IAppBuilder, Func<T>, Action<IAkavacheBuilder>, string?)
Initializes the CacheDatabase with a custom serializer configuration and builder settings.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavacheCacheDatabase<T>(this IAppBuilder builder, Func<T> configureSerializer, Action<IAkavacheBuilder> configure, string? applicationName = null) where T : ISerializer, new()
Parameters
builderIAppBuilder The Splat application builder to configure.
configureSerializerFunc<T>A function that creates and configures the serializer instance.
configureAction<IAkavacheBuilder >An action to configure the Akavache builder settings.
applicationNamestringThe name of the application for cache directory paths.
Returns
- IApp
Builder The configured Splat application builder for method chaining.
Type Parameters
TThe type of serializer to use for cache operations.
Exceptions
- Argument
Null Exception Thrown when
builderis null.
WithAkavacheCacheDatabase<T>(IAppBuilder, Func<T>, string?)
Initializes the CacheDatabase with default in-memory caches and a custom serializer configuration. This is a safe default configuration that does not require any additional packages.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavacheCacheDatabase<T>(this IAppBuilder builder, Func<T> configureSerializer, string? applicationName = null) where T : ISerializer, new()
Parameters
builderIAppBuilder The Splat application builder to configure.
configureSerializerFunc<T>A function that creates and configures the serializer instance.
applicationNamestringThe name of the application for cache directory paths. If null, uses the current ApplicationName.
Returns
- IApp
Builder The configured Splat application builder for method chaining.
Type Parameters
TThe type of serializer to use for cache operations.
Exceptions
- Argument
Null Exception Thrown when
builderis null.
WithAkavacheCacheDatabase<T>(IAppBuilder, string?)
Initializes the CacheDatabase with default in-memory caches. This is the safest default configuration as it does not require any additional packages.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavacheCacheDatabase<T>(this IAppBuilder builder, string? applicationName = null) where T : ISerializer, new()
Parameters
builderIAppBuilder The Splat application builder to configure.
applicationNamestringThe name of the application for cache directory paths. If null, uses the current ApplicationName.
Returns
- IApp
Builder The configured Splat application builder for method chaining.
Type Parameters
TThe type of serializer to use for cache operations.
Exceptions
- Argument
Null Exception Thrown when
builderis null.
WithAkavache<T>(IAppBuilder, string?, Action<IAkavacheBuilder>, Action<IAkavacheInstance>)
Initializes CacheDatabase with a custom builder configuration.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavache<T>(this IAppBuilder builder, string? applicationName, Action<IAkavacheBuilder> configure, Action<IAkavacheInstance> instance) where T : ISerializer, new()
Parameters
builderIAppBuilder The builder.
applicationNamestringName of the application.
configureAction<IAkavacheBuilder >An action to configure the CacheDatabase builder.
instanceAction<IAkavacheInstance >The instance.
Returns
- IApp
Builder The configured builder.
Type Parameters
TThe type of Serializer.
Exceptions
- Argument
Null Exception builder or configure or instance.
- Argument
Null Exception builder.
WithAkavache<T>(IAppBuilder, string?, Action<IAkavacheBuilder>, Action<IMutableDependencyResolver, IAkavacheInstance>)
Initializes CacheDatabase with a custom builder configuration.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavache<T>(this IAppBuilder builder, string? applicationName, Action<IAkavacheBuilder> configure, Action<IMutableDependencyResolver, IAkavacheInstance> instance) where T : ISerializer, new()
Parameters
builderIAppBuilder The builder.
applicationNamestringName of the application.
configureAction<IAkavacheBuilder >An action to configure the CacheDatabase builder.
instanceAction<IMutableDependency , IAkavacheResolver Instance >The instance.
Returns
- IApp
Builder The configured builder.
Type Parameters
TThe type of Serializer.
Exceptions
- Argument
Null Exception builder or configure or instance.
- Argument
Null Exception builder.
WithAkavache<T>(IAppBuilder, string?, Action<IAkavacheInstance>)
Initializes CacheDatabase with a set of default in-memory caches. This is the safest default as it doesn't require any additional packages.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavache<T>(this IAppBuilder builder, string? applicationName, Action<IAkavacheInstance> instance) where T : ISerializer, new()
Parameters
builderIAppBuilder The builder.
applicationNamestringThe application name for cache directories. If null, uses the current ApplicationName.
instanceAction<IAkavacheInstance >The instance created.
Returns
- IApp
Builder A BlobCache builder for further configuration.
Type Parameters
TThe type of Serializer.
Exceptions
- Argument
Null Exception builder.
WithAkavache<T>(IAppBuilder, string?, Action<IMutableDependencyResolver, IAkavacheInstance>)
Initializes CacheDatabase with a set of default in-memory caches. This is the safest default as it doesn't require any additional packages.
[RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static IAppBuilder WithAkavache<T>(this IAppBuilder builder, string? applicationName, Action<IMutableDependencyResolver, IAkavacheInstance> instance) where T : ISerializer, new()
Parameters
builderIAppBuilder The builder.
applicationNamestringThe application name for cache directories. If null, uses the current ApplicationName.
instanceAction<IMutableDependency , IAkavacheResolver Instance >The instance created.
Returns
- IApp
Builder A BlobCache builder for further configuration.
Type Parameters
TThe type of Serializer.
Exceptions
- Argument
Null Exception builder.
WithInMemory(IAkavacheBuilder)
Withes the in memory.
Parameters
builderIAkavacheBuilder The builder.
Returns
- IAkavache
Builder The builder instance for fluent configuration.
Exceptions
- Argument
Null Exception builder.