Try our conversational search powered by Generative AI!

Class DataAccessOptions

Specifies options on how to connect to the database.

Inheritance
System.Object
DataAccessOptions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Data
Assembly: EPiServer.Data.dll
Version: 11.20.7
Syntax
[Options]
public class DataAccessOptions

Constructors

DataAccessOptions()

Declaration
public DataAccessOptions()

Properties

ConnectionStrings

List of connection strings to use.

Declaration
public IList<ConnectionStringOptions> ConnectionStrings { get; }
Property Value
Type Description
System.Collections.Generic.IList<ConnectionStringOptions>

CreateDatabaseSchema

Defines if the database schema should be created automatically when the system is initialized and the database is empty.

Declaration
public bool CreateDatabaseSchema { get; set; }
Property Value
Type Description
System.Boolean
Remarks

The default value is false.

DatabaseMode

Defines the mode that the database should be working in.

Declaration
public DatabaseMode DatabaseMode { get; set; }
Property Value
Type Description
DatabaseMode
Remarks

The default mode is ReadWrite.

DatabaseQueryTimeout

The timeout used for database queries.

Declaration
public TimeSpan DatabaseQueryTimeout { get; set; }
Property Value
Type Description
System.TimeSpan
Remarks

The default timeout is 30 s.

DefaultConnectionStringName

The name of the default connection string to use.

Declaration
public string DefaultConnectionStringName { get; set; }
Property Value
Type Description
System.String
Remarks

The default connection string is 'EPiServerDB'.

DisableDateTimeKindValidation

Defines if the datetime kind of the database should be validated to be UTC when the system is initialized..

Declaration
public bool DisableDateTimeKindValidation { get; set; }
Property Value
Type Description
System.Boolean
Remarks

The default value is true.

Retries

The number of retries in case a deadlock is detected

Declaration
public int Retries { get; set; }
Property Value
Type Description
System.Int32
Remarks

The default number of retries is 3.

RetryDelay

The delay between retries in case a deadlock is detected.

Declaration
public TimeSpan RetryDelay { get; set; }
Property Value
Type Description
System.TimeSpan
Remarks

The default delay is 100 ms.

UpdateDatabaseSchema

Defines if the database schema should be updated automatically when the system is initialized in case the schema has changed.

Declaration
public bool UpdateDatabaseSchema { get; set; }
Property Value
Type Description
System.Boolean
Remarks

The default value is false.

Methods

SetConnectionString(String)

Sets the default connection string to the provided value.

Declaration
public void SetConnectionString(string connectionString)
Parameters
Type Name Description
System.String connectionString

The default connection string to use.

Remarks

If a default connection string already exist it will be overwritten. If no connection string that matches the default connection string exists it will be added.

Extension Methods