Skip to main content

SqlMapper.Settings

Permits specifying certain SqlMapper values globally.

Assembly: ServiceStack.OrmLite.dll
View Source
Declaration
public static class Settings : object

Properties

UseSingleResultOptimization

Gets or sets whether Dapper should use the CommandBehavior.SingleResult optimization

View Source
Declaration
public static bool UseSingleResultOptimization { get; set; }

UseSingleRowOptimization

Gets or sets whether Dapper should use the CommandBehavior.SingleRow optimization

View Source
Declaration
public static bool UseSingleRowOptimization { get; set; }

CommandTimeout

Specifies the default Command Timeout for all Queries

View Source
Declaration
public static int? CommandTimeout { get; set; }

ApplyNullValues

Indicates whether nulls in data are silently ignored (default) vs actively applied and assigned to members

View Source
Declaration
public static bool ApplyNullValues { get; set; }

PadListExpansions

Should list expansions be padded with null-valued parameters, to prevent query-plan saturation? For example, an 'in @foo' expansion with 7, 8 or 9 values will be sent as a list of 10 values, with 3, 2 or 1 of them null. The padding size is relative to the size of the list; "next 10" under 150, "next 50" under 500, "next 100" under 1500, etc.

View Source
Declaration
public static bool PadListExpansions { get; set; }

InListStringSplitCount

If set (non-negative), when performing in-list expansions of integer types ("where id in @ids", etc), switch to a string_split based operation if there are more than this many elements. Note that this feautre requires SQL Server 2016 / compatibility level 130 (or above).

View Source
Declaration
public static int InListStringSplitCount { get; set; }

Methods

SetDefaults()

Resets all Settings to their default values

View Source
Declaration
public static void SetDefaults()