Docs / Configuration with MooDbContextOptions

Configuration with MooDbContextOptions

What this page covers#

This page explains the two main settings on MooDbContextOptions.

The options#

MooDbContextOptions currently exposes:

  • CommandTimeoutSeconds
  • StrictAutoMapping

CommandTimeoutSeconds#

This sets the default command timeout, in seconds, used when a command-specific timeout is not supplied.

The default is 30.

</> C#
var db = new MooDbContext(connectionString, new MooDbContextOptions
{
    CommandTimeoutSeconds = 60
});

StrictAutoMapping#

This turns on stricter validation for MooDb's automatic result mapping.

</> C#
var db = new MooDbContext(connectionString, new MooDbContextOptions
{
    StrictAutoMapping = true
});

Strict mode applies consistently across constructor mapping and property mapping.