Link Search Menu Expand Document

GlobalConfigurationOptions


This class contains the different options that is being used to define a globalized configuration for the library.

Properties

Below is the list of properties.

NameDescription
ConversionTypeA property that is being used to gets or sets the value that defines the conversion logic when converting an instance of DbDataReader into a .NET CLR class.
DefaultBatchOperationSizeA property that is being used to gets or sets the default value of the batch operation size. The value defines on this property mainly affects the batch size of the InsertAll, MergeAll and UpdateAll operations.
DefaultCacheItemExpirationInMinutesA property that is being used to gets or sets the default value of the cache expiration in minutes.
EnumDefaultDatabaseTypeA property that is being used to gets or sets the default equivalent DbType of an enumeration if it is being used as a parameter to the execution of any non-entity-based operations.
KeyColumnReturnBehaviorA property that is being used to gets or sets the default value of how the push operations (i.e.: Insert, InsertAll, Merge and MergeAll) behaves when returning the value from the key columns (i.e.: Primary and Identity).

Setup

Below is the code used to setup the application using this class.

var options = new GlobalConfigurationOptions()
{
    ConversionType = ConversionType.Default,
    DefaultBatchOperationSize = Constant.DefaultBatchOperationSize,
    DefaultCacheItemExpirationInMinutes = Constant.DefaultCacheItemExpirationInMinutes,
    EnumDefaultDatabaseType = DbType.String,
    KeyColumnReturnBehavior = KeyColumnReturnBehavior.IdentityOrElsePrimary
};
GlobalConfiguration.Setup(options);

All the properties defined in the options are optional. The one defined above are the default values.