Table of Contents

Struct SqlParameterBinderCreationOptions

Namespace
LfrlAnvil.Sql.Statements.Compilers
Assembly
LfrlAnvil.Sql.Core.dll

Represents available options for creating parameter binder expressions through ISqlParameterBinderFactory.

public readonly struct SqlParameterBinderCreationOptions
Inherited Members

Fields

Default

Represents default options.

public static readonly SqlParameterBinderCreationOptions Default

Field Value

SqlParameterBinderCreationOptions

Properties

Context

Optional SqlNodeInterpreterContext instance used for further parameter validation.

public SqlNodeInterpreterContext? Context { get; }

Property Value

SqlNodeInterpreterContext

IgnoreNullValues

Specifies whether or not to completely ignore source null values.

public bool IgnoreNullValues { get; }

Property Value

bool

ParameterConfigurations

Collection of explicit SqlParameterConfiguration instances.

public ReadOnlySpan<SqlParameterConfiguration> ParameterConfigurations { get; }

Property Value

ReadOnlySpan<SqlParameterConfiguration>

ReduceCollections

Specifies whether or not source collection values should create separate SQL parameters for each element. string and byte arrays are excluded.

public bool ReduceCollections { get; }

Property Value

bool

SourceTypeMemberPredicate

Specifies an optional source type's field or property filter. Members that return false will be ignored.

public Func<MemberInfo, bool>? SourceTypeMemberPredicate { get; }

Property Value

Func<MemberInfo, bool>

Methods

CreateParameterConfigurationLookups(Type?)

[Pure]
public SqlParameterBinderCreationOptions.ParameterConfigurationLookups CreateParameterConfigurationLookups(Type? sourceType)

Parameters

sourceType Type

Parameter source type.

Returns

SqlParameterBinderCreationOptions.ParameterConfigurationLookups

New SqlParameterBinderCreationOptions.ParameterConfigurationLookups instance.

Remarks

Custom selectors will be ignored when sourceType is null.

EnableCollectionReduction(bool)

Creates a new SqlParameterBinderCreationOptions instance with changed ReduceCollections.

[Pure]
public SqlParameterBinderCreationOptions EnableCollectionReduction(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

SqlParameterBinderCreationOptions

New SqlParameterBinderCreationOptions instance.

EnableIgnoringOfNullValues(bool)

Creates a new SqlParameterBinderCreationOptions instance with changed IgnoreNullValues.

[Pure]
public SqlParameterBinderCreationOptions EnableIgnoringOfNullValues(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

SqlParameterBinderCreationOptions

New SqlParameterBinderCreationOptions instance.

SetContext(SqlNodeInterpreterContext?)

Creates a new SqlParameterBinderCreationOptions instance with changed Context.

[Pure]
public SqlParameterBinderCreationOptions SetContext(SqlNodeInterpreterContext? context)

Parameters

context SqlNodeInterpreterContext

Value to set.

Returns

SqlParameterBinderCreationOptions

New SqlParameterBinderCreationOptions instance.

SetSourceTypeMemberPredicate(Func<MemberInfo, bool>?)

Creates a new SqlParameterBinderCreationOptions instance with changed SourceTypeMemberPredicate.

[Pure]
public SqlParameterBinderCreationOptions SetSourceTypeMemberPredicate(Func<MemberInfo, bool>? predicate)

Parameters

predicate Func<MemberInfo, bool>

Value to set.

Returns

SqlParameterBinderCreationOptions

New SqlParameterBinderCreationOptions instance.

With(SqlParameterConfiguration)

Creates a new SqlParameterBinderCreationOptions instance with added SqlParameterConfiguration instance.

[Pure]
public SqlParameterBinderCreationOptions With(SqlParameterConfiguration configuration)

Parameters

configuration SqlParameterConfiguration

Value to add.

Returns

SqlParameterBinderCreationOptions

New SqlParameterBinderCreationOptions instance.