Class MemberParser
A validated mapping between a class member (Property, Field, or Method) and a database column matcher.
public record MemberParser : IEquatable<MemberParser>
- Inheritance
-
MemberParser
- Implements
- Inherited Members
- Extension Methods
Remarks
This class is used during the "Completion" phase of object parsing, where an existing instance is populated with additional data not provided to the constructor.
Constructors
MemberParser(MemberInfo, ParamInfo)
Initializes a new instance of the MemberParser class.
public MemberParser(MemberInfo Member, ParamInfo Param)
Parameters
MemberMemberInfoThe property, field, or method to map.
ParamParamInfoThe column matching rules for the member.
Exceptions
- Exception
Thrown if the member is static, read-only, or type-mismatched.
Fields
Member
The reflection metadata for the member being populated.
public readonly MemberInfo Member
Field Value
Param
The matcher that negotiates the data type and column name for this member.
public readonly ParamInfo Param
Field Value
TargetType
The type of the class that owns or receives this member assignment.
public readonly Type TargetType
Field Value
Methods
TryNew(MemberInfo, ParamInfo, out MemberParser, bool)
Attempts to create a new MemberParser.
public static bool TryNew(MemberInfo member, ParamInfo param, out MemberParser memberParser, bool allowNonPublicSetter = false)
Parameters
memberMemberInfoThe candidate member for parsing.
paramParamInfoThe matcher to associate with the member.
memberParserMemberParserWhen this method returns, contains the parser if successful, otherwise null.
allowNonPublicSetterboolWhether a non-public property setter may be used.
Returns
- bool
trueif the member is a valid, writable target, otherwisefalse.