Configuration with MooDbContextOptions
What this page covers#
This page explains the two main settings on MooDbContextOptions.
The options#
MooDbContextOptions currently exposes:
CommandTimeoutSecondsStrictAutoMapping
CommandTimeoutSeconds#
This sets the default command timeout, in seconds, used when a command-specific timeout is not supplied.
The default is 30.
var db = new MooDbContext(connectionString, new MooDbContextOptions { CommandTimeoutSeconds = 60 });
StrictAutoMapping#
This turns on stricter validation for MooDb's automatic result mapping.
var db = new MooDbContext(connectionString, new MooDbContextOptions { StrictAutoMapping = true });
Strict mode applies consistently across constructor mapping and property mapping.