Link Search Menu Expand Document

GlobalConfigurationOptions


This class contains the options used to define global configuration for the library.

Properties

NameDescription
ConversionTypeDefines the conversion logic when mapping a DbDataReader to a .NET CLR class.
DefaultBatchOperationSizeThe default batch size for InsertAll, MergeAll, and UpdateAll operations.
DefaultCacheItemExpirationInMinutesThe default cache expiration in minutes.
EnumDefaultDatabaseTypeThe default DbType for enumerations used as parameters in non-entity-based operations.
KeyColumnReturnBehaviorDefines how push operations (Insert, InsertAll, Merge, MergeAll) return values from key columns (Primary and Identity).

Setup

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

All options are optional. The values shown above are the defaults.