Table of Contents

Struct SqlQueryMemberConfiguration

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

Represents an explicit row member configuration for ISqlQueryReaderFactory.

public readonly struct SqlQueryMemberConfiguration
Inherited Members

Properties

CustomMapping

Custom value mapping from source to row type's member.

public LambdaExpression? CustomMapping { get; }

Property Value

LambdaExpression

CustomMappingDataReaderType

Source data reader type from the CustomMapping.

public Type? CustomMappingDataReaderType { get; }

Property Value

Type

CustomMappingMemberType

Value type from the CustomMapping.

public Type? CustomMappingMemberType { get; }

Property Value

Type

IsIgnored

Specifies whether or not the associated row type member should be completely ignored.

public bool IsIgnored { get; }

Property Value

bool

MemberName

Row type's field or property name.

public string MemberName { get; }

Property Value

string

SourceFieldName

Name of the source field to read a value from.

public string? SourceFieldName { get; }

Property Value

string

Methods

From(string, string)

Creates a new SqlQueryMemberConfiguration instance that causes the provided row type member's value to be read from another source field.

[Pure]
public static SqlQueryMemberConfiguration From(string memberName, string sourceFieldName)

Parameters

memberName string

Row type's field or property name.

sourceFieldName string

Name of the source field to read a value from..

Returns

SqlQueryMemberConfiguration

New SqlQueryMemberConfiguration instance.

From<T>(string, Expression<Func<ISqlDataRecordFacade<IDataRecord>, T>>)

Creates a new SqlQueryMemberConfiguration instance that causes the provided row type member's value to be read from a custom expression.

[Pure]
public static SqlQueryMemberConfiguration From<T>(string memberName, Expression<Func<ISqlDataRecordFacade<IDataRecord>, T>> mapping)

Parameters

memberName string

Row type's field or property name.

mapping Expression<Func<ISqlDataRecordFacade<IDataRecord>, T>>

Custom value mapping from source to row type's member.

Returns

SqlQueryMemberConfiguration

New SqlQueryMemberConfiguration instance.

Type Parameters

T

Row member type.

Exceptions

SqlCompilerConfigurationException

When any field name used in ISqlDataRecordFacade<TDataRecord> method calls could not be resolved as a constant value.

From<TDataRecord, TMemberType>(string, Expression<Func<ISqlDataRecordFacade<TDataRecord>, TMemberType>>)

Creates a new SqlQueryMemberConfiguration instance that causes the provided row type member's value to be read from a custom expression.

[Pure]
public static SqlQueryMemberConfiguration From<TDataRecord, TMemberType>(string memberName, Expression<Func<ISqlDataRecordFacade<TDataRecord>, TMemberType>> mapping) where TDataRecord : IDataRecord

Parameters

memberName string

Row type's field or property name.

mapping Expression<Func<ISqlDataRecordFacade<TDataRecord>, TMemberType>>

Custom value mapping from source to row type's member.

Returns

SqlQueryMemberConfiguration

New SqlQueryMemberConfiguration instance.

Type Parameters

TDataRecord

Source DB data record type.

TMemberType

Row member type.

Exceptions

SqlCompilerConfigurationException

When any field name used in ISqlDataRecordFacade<TDataRecord> method calls could not be resolved as a constant value.

Ignore(string)

Creates a new SqlQueryMemberConfiguration instance that causes the provided row type member to be ignored.

[Pure]
public static SqlQueryMemberConfiguration Ignore(string memberName)

Parameters

memberName string

Row type's field or property name.

Returns

SqlQueryMemberConfiguration

New SqlQueryMemberConfiguration instance.