,System.String)} ,System.String,Akavache.Reactive.Core.FileLocationOption)} ,System.String)} ,System.String,Akavache.Reactive.Core.FileLocationOption)} ,System.Action{Akavache.Reactive.IAkavacheBuilder},System.String)} ,System.Action{Akavache.Reactive.IAkavacheBuilder},System.String,Akavache.Reactive.Core.FileLocationOption)}
CacheDatabase.Initialize(string) method¶
Defined in
Type: CacheDatabase
Namespace: Akavache.Reactive
Assembly: Akavache.Reactive.dll
Applies to
net10.0, net10.0-ios26.0, net10.0-maccatalyst26.0, net10.0-android36.0, net10.0-windows10.0.19041, net10.0-macos26.0, net9.0, net9.0-windows10.0.19041, net8.0, net8.0-windows10.0.19041, net462, net481
Overloads¶
-
public static void Initialize<T>(string applicationName) where T : class, ISerializer, new() -
public static void Initialize<T>(string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new() -
public static void Initialize<T>(Func<T> configureSerializer, string applicationName) where T : class, ISerializer, new() -
public static void Initialize<T>(Func<T> configureSerializer, string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new() -
public static void Initialize<T>(Action<IAkavacheBuilder> configure, string applicationName) where T : class, ISerializer, new() -
public static void Initialize<T>(Action<IAkavacheBuilder> configure, string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new() -
public static void Initialize<T>(Func<T> configureSerializer, Action<IAkavacheBuilder> configure, string applicationName) where T : class, ISerializer, new() -
public static void Initialize<T>(Func<T> configureSerializer, Action<IAkavacheBuilder> configure, string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new()
1. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(string applicationName) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with default in-memory caches and a required application name.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
| System.InvalidOperationException | Failed to create an AkavacheBuilder instance. |
2. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with default in-memory caches and a required application name.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
fileLocationOption | [FileLocationOption](# | The file location option. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
| System.InvalidOperationException | Failed to create an AkavacheBuilder instance. |
3. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(Func<T> configureSerializer, string applicationName) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with default in-memory caches, a required application name, and a custom serializer factory.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
configureSerializer | Func | The Serializer configuration. |
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
4. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(Func<T> configureSerializer, string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with default in-memory caches, a required application name, and a custom serializer factory.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
configureSerializer | Func | The Serializer configuration. |
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
fileLocationOption | [FileLocationOption](# | The file location option. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
5. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(Action<IAkavacheBuilder> configure, string applicationName) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with a custom builder configuration and a required application name.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
configure | Action | An action to configure the Akavache builder. |
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
| System.ArgumentNullException | Thrown when configure is null. |
6. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(Action<IAkavacheBuilder> configure, string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with a custom builder configuration and a required application name.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
configure | Action | An action to configure the Akavache builder. |
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
fileLocationOption | [FileLocationOption](# | The file location option. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
| System.ArgumentNullException | Thrown when configure is null. |
7. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(Func<T> configureSerializer, Action<IAkavacheBuilder> configure, string applicationName) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with a custom builder configuration and a required application name.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
configureSerializer | Func | The Serializer configuration. |
configure | Action | An action to configure the Akavache builder. |
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
| System.ArgumentNullException | Thrown when configure is null. |
8. Overload¶
Attributes: [RequiresUnreferencedCode("Serializers require types to be preserved for serialization.")]
public static void Initialize<T>(Func<T> configureSerializer, Action<IAkavacheBuilder> configure, string applicationName, FileLocationOption fileLocationOption) where T : class, ISerializer, new()
Summary: Initializes CacheDatabase with a custom builder configuration and a required application name.
Type parameters
| Name | Description |
|---|---|
T | The serializer. |
Parameters
| Name | Type | Description |
|---|---|---|
configureSerializer | Func | The Serializer configuration. |
configure | Action | An action to configure the Akavache builder. |
applicationName | string | The application name for cache directories. Must not be null or whitespace. |
fileLocationOption | [FileLocationOption](# | The file location option. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when applicationName is null or whitespace. |
| System.ArgumentNullException | Thrown when configure is null. |