Search Results for

Show / Hide Table of Contents

# Class IgniteDbConfiguration

implementation that uses Ignite as a second-level cache for Entity Framework queries.

##### Inheritance

System.Object
IgniteDbConfiguration

###### Namespace: Apache.Ignite.EntityFramework

###### Assembly: Apache.Ignite.EntityFramework.dll

##### Syntax

    public class IgniteDbConfiguration : DbConfiguration

### Constructors

#### IgniteDbConfiguration()

Initializes a new instance of the IgniteDbConfiguration class.

This constructor uses default Ignite instance (with null IgniteInstanceName) and a cache with DefaultCacheNamePrefix name.

Ignite instance will be started automatically, if it is not started yet.

IgniteConfigurationSection with name Apache.Ignite.EntityFramework.IgniteDbConfiguration.ConfigurationSectionName will be picked up when starting Ignite, if present.

##### Declaration

    public IgniteDbConfiguration()

#### IgniteDbConfiguration(IgniteConfiguration, CacheConfiguration, CacheConfiguration, IDbCachingPolicy)

Initializes a new instance of the IgniteDbConfiguration class.

##### Declaration

    public IgniteDbConfiguration(IgniteConfiguration igniteConfiguration, CacheConfiguration metaCacheConfiguration, CacheConfiguration dataCacheConfiguration, IDbCachingPolicy policy)

##### Parameters

Type | Name | Description
--- | --- | ---
IgniteConfiguration | igniteConfiguration | The ignite configuration to use for starting Ignite instance.
CacheConfiguration | metaCacheConfiguration | Configuration of the metadata cache which holds entity set information. Null for default configuration. This cache holds small amount of data, but should not lose entries. At least one backup recommended.
CacheConfiguration | dataCacheConfiguration | Configuration of the data cache which holds query results. Null for default configuration. This cache tolerates lost data and can have no backups.
IDbCachingPolicy | policy | The caching policy. Null for default DbCachingPolicy.

#### IgniteDbConfiguration(IIgnite, CacheConfiguration, CacheConfiguration, IDbCachingPolicy)

Initializes a new instance of the IgniteDbConfiguration class.

##### Declaration

    public IgniteDbConfiguration(IIgnite ignite, CacheConfiguration metaCacheConfiguration, CacheConfiguration dataCacheConfiguration, IDbCachingPolicy policy)

##### Parameters

Type | Name | Description
--- | --- | ---
IIgnite | ignite | The ignite instance to use.
CacheConfiguration | metaCacheConfiguration | Configuration of the metadata cache which holds entity set information. Null for default configuration. This cache holds small amount of data, but should not lose entries. At least one backup recommended.
CacheConfiguration | dataCacheConfiguration | Configuration of the data cache which holds query results. Null for default configuration. This cache tolerates lost data and can have no backups.
IDbCachingPolicy | policy | The caching policy. Null for default DbCachingPolicy.

#### IgniteDbConfiguration(String, CacheConfiguration, CacheConfiguration, IDbCachingPolicy)

Initializes a new instance of the IgniteDbConfiguration class.

##### Declaration

    public IgniteDbConfiguration(string configurationSectionName, CacheConfiguration metaCacheConfiguration, CacheConfiguration dataCacheConfiguration, IDbCachingPolicy policy)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | configurationSectionName | Name of the configuration section.
CacheConfiguration | metaCacheConfiguration | Configuration of the metadata cache which holds entity set information. Null for default configuration. This cache holds small amount of data, but should not lose entries. At least one backup recommended.
CacheConfiguration | dataCacheConfiguration | Configuration of the data cache which holds query results. Null for default configuration. This cache tolerates lost data and can have no backups.
IDbCachingPolicy | policy | The caching policy. Null for default DbCachingPolicy.

#### IgniteDbConfiguration(String, String, IDbCachingPolicy)

Initializes a new instance of the IgniteDbConfiguration class.

##### Declaration

    public IgniteDbConfiguration(string configurationSectionName, string cacheNamePrefix, IDbCachingPolicy policy)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | configurationSectionName | Name of the configuration section.
System.String | cacheNamePrefix | The cache name prefix for Data and Metadata caches.
IDbCachingPolicy | policy | The caching policy. Null for default DbCachingPolicy.

### Fields

#### DefaultCacheNamePrefix

The default cache name to be used for cached EF data.

##### Declaration

    public const string DefaultCacheNamePrefix = "entityFrameworkQueryCache"

##### Field Value

Type | Description
--- | ---
System.String |

### Methods

#### InitializeIgniteCaching(DbConfiguration, IIgnite, CacheConfiguration, CacheConfiguration, IDbCachingPolicy)

Initializes Ignite caching for specified . This method should be used when it is not possible to use or inherit IgniteDbConfiguration.

##### Declaration

    public static void InitializeIgniteCaching(DbConfiguration dbConfiguration, IIgnite ignite, CacheConfiguration metaCacheConfiguration, CacheConfiguration dataCacheConfiguration, IDbCachingPolicy policy)

##### Parameters

Type | Name | Description
--- | --- | ---
DbConfiguration | dbConfiguration | instance to be initialized for Ignite caching.
IIgnite | ignite | The ignite instance to use.
CacheConfiguration | metaCacheConfiguration | Configuration of the metadata cache which holds entity set information. Null for default configuration. This cache holds small amount of data, but should not lose entries. At least one backup recommended.
CacheConfiguration | dataCacheConfiguration | Configuration of the data cache which holds query results. Null for default configuration. This cache tolerates lost data and can have no backups.
IDbCachingPolicy | policy | The caching policy. Null for default DbCachingPolicy.