Link Search Menu Expand Document

GlobalConfiguration


This class defines global configuration for the library and must be called during application startup.

Methods

NameDescription
SetupSets up the global configuration.

Properties

NameDescription
OptionsThe configuration options defined during setup.

Setup

Use this method to configure options via the GlobalConfigurationOptions class.

GlobalConfiguration
    .Setup()
    .UseSqlServer();

UseSqlServer() is an extension method provided by the RepoDb.SqlServer package. Other extension packages provide their own equivalent methods.

Options can also be specified during setup.

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

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