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
CustomMappingDataReaderType
Source data reader type from the CustomMapping.
public Type? CustomMappingDataReaderType { get; }
Property Value
CustomMappingMemberType
Value type from the CustomMapping.
public Type? CustomMappingMemberType { get; }
Property Value
IsIgnored
Specifies whether or not the associated row type member should be completely ignored.
public bool IsIgnored { get; }
Property Value
MemberName
Row type's field or property name.
public string MemberName { get; }
Property Value
SourceFieldName
Name of the source field to read a value from.
public string? SourceFieldName { get; }
Property Value
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
stringRow type's field or property name.
sourceFieldName
stringName 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
stringRow 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
stringRow 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
stringRow type's field or property name.
Returns
- SqlQueryMemberConfiguration
New SqlQueryMemberConfiguration instance.