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
Properties
Context
Optional SqlNodeInterpreterContext instance used for further parameter validation.
public SqlNodeInterpreterContext? Context { get; }
Property Value
IgnoreNullValues
Specifies whether or not to completely ignore source null values.
public bool IgnoreNullValues { get; }
Property Value
ParameterConfigurations
Collection of explicit SqlParameterConfiguration instances.
public ReadOnlySpan<SqlParameterConfiguration> ParameterConfigurations { get; }
Property Value
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
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
Methods
CreateParameterConfigurationLookups(Type?)
Creates a new SqlParameterBinderCreationOptions.ParameterConfigurationLookups instance for current ParameterConfigurations.
[Pure]
public SqlParameterBinderCreationOptions.ParameterConfigurationLookups CreateParameterConfigurationLookups(Type? sourceType)
Parameters
sourceType
TypeParameter 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
boolValue to set. Equal to true by default.
Returns
EnableIgnoringOfNullValues(bool)
Creates a new SqlParameterBinderCreationOptions instance with changed IgnoreNullValues.
[Pure]
public SqlParameterBinderCreationOptions EnableIgnoringOfNullValues(bool enabled = true)
Parameters
enabled
boolValue to set. Equal to true by default.
Returns
SetContext(SqlNodeInterpreterContext?)
Creates a new SqlParameterBinderCreationOptions instance with changed Context.
[Pure]
public SqlParameterBinderCreationOptions SetContext(SqlNodeInterpreterContext? context)
Parameters
context
SqlNodeInterpreterContextValue to set.
Returns
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
With(SqlParameterConfiguration)
Creates a new SqlParameterBinderCreationOptions instance with added SqlParameterConfiguration instance.
[Pure]
public SqlParameterBinderCreationOptions With(SqlParameterConfiguration configuration)
Parameters
configuration
SqlParameterConfigurationValue to add.