Table of Contents

Class Configuration

Namespace
LinqToDB.Common
Assembly
linq2db.dll

Contains global linq2db settings.

public static class Configuration
Inheritance
Configuration

Fields

ContinueOnCapturedContext

Defines value to pass to ConfigureAwait(bool) method for all linq2db internal await operations. Default value: false.

public static bool ContinueOnCapturedContext

Field Value

bool

IsStructIsScalarType

If true - non-primitive and non-enum value types (structures) will be treated as scalar types (e.g. DateTime) during mapping; otherwise they will be treated the same way as classes. Default value: true.

public static bool IsStructIsScalarType

Field Value

bool

OptimizeForSequentialAccess

Enables mapping expression to be compatible with SequentialAccess behavior. Note that it doesn't switch linq2db to use SequentialAccess behavior for queries, so this optimization could be used for Default too. Default value: false.

public static bool OptimizeForSequentialAccess

Field Value

bool

UseEnumValueNameForStringColumns

If true - Enum values are stored as by calling ToString(). Default value: true.

public static bool UseEnumValueNameForStringColumns

Field Value

bool

Properties

MaxArrayParameterLengthLogging

Determines number of items after which logging of collection data in SQL will be truncated. This is to avoid Out-Of-Memory exceptions when getting SqlText from TraceInfo or IExpressionQuery for logging or other purposes.

public static int MaxArrayParameterLengthLogging { get; set; }

Property Value

int

Remarks

This value defaults to 8 elements. Use a value of -1 to disable and always log full collection. Set to 0 to truncate all data.

MaxBinaryParameterLengthLogging

Determines the length after which logging of binary data in SQL will be truncated. This is to avoid Out-Of-Memory exceptions when getting SqlText from TraceInfo or IExpressionQuery for logging or other purposes.

public static int MaxBinaryParameterLengthLogging { get; set; }

Property Value

int

Remarks

This value defaults to 100. Use a value of -1 to disable and always log full binary. Set to 0 to truncate all binary data.

MaxStringParameterLengthLogging

Determines the length after which logging of string data in SQL will be truncated. This is to avoid Out-Of-Memory exceptions when getting SqlText from TraceInfo or IExpressionQuery for logging or other purposes.

public static int MaxStringParameterLengthLogging { get; set; }

Property Value

int

Remarks

This value defaults to 200. Use a value of -1 to disable and always log full string. Set to 0 to truncate all string data.

TraceMaterializationActivity

Enables tracing of object materialization activity. It can significantly break performance if tracing consumer performs slow, so it is disabled by default.

public static bool TraceMaterializationActivity { get; set; }

Property Value

bool

UseNullableTypesMetadata

Whether or not Nullable Reference Types annotations from C# are read and taken into consideration to determine if a column or association can be null. Nullable Types can be overriden with explicit CanBeNull annotations in [Column], [Association], or [Nullable].

public static bool UseNullableTypesMetadata { get; set; }

Property Value

bool

Remarks

Defaults to false.