Class AssociationDescriptor
Stores association descriptor.
public class AssociationDescriptor
- Inheritance
-
AssociationDescriptor
- Extension Methods
Constructors
AssociationDescriptor(Type, MemberInfo, string[], string[], string?, Expression?, string?, Expression?, string?, string?, Expression?, bool?, string?)
Creates descriptor instance.
public AssociationDescriptor(Type type, MemberInfo memberInfo, string[] thisKey, string[] otherKey, string? expressionPredicate, Expression? predicate, string? expressionQueryMethod, Expression? expressionQuery, string? storage, string? associationSetterExpressionMethod, Expression? associationSetterExpression, bool? canBeNull, string? aliasName)
Parameters
type
TypeFrom (this) side entity mapping type.
memberInfo
MemberInfoAssociation member (field, property or method).
thisKey
string[]List of names of from (this) key members.
otherKey
string[]List of names of to (other) key members.
expressionPredicate
stringOptional predicate expression source property or method.
predicate
ExpressionOptional predicate expression.
expressionQueryMethod
stringOptional name of query method.
expressionQuery
ExpressionOptional query expression.
storage
stringOptional association value storage field or property name.
associationSetterExpressionMethod
stringOptional name of setter method.
associationSetterExpression
ExpressionOptional setter expression.
canBeNull
bool?If
true
, association will generate outer join, otherwise - inner join.aliasName
stringOptional alias for representation in SQL.
Properties
AliasName
Gets alias for association. Used in SQL generation process.
public string? AliasName { get; }
Property Value
AssociationSetterExpression
Gets optional setter expression.
public Expression? AssociationSetterExpression { get; }
Property Value
AssociationSetterExpressionMethod
Gets optional setter method source property or method.
public string? AssociationSetterExpressionMethod { get; }
Property Value
CanBeNull
Gets join type, generated for current association.
If true
, association will generate outer join, otherwise - inner join.
public bool CanBeNull { get; }
Property Value
ExpressionPredicate
Gets optional predicate expression source property or method.
public string? ExpressionPredicate { get; }
Property Value
ExpressionQuery
Gets optional query expression.
public Expression? ExpressionQuery { get; }
Property Value
ExpressionQueryMethod
Gets optional query method source property or method.
public string? ExpressionQueryMethod { get; }
Property Value
IsList
public bool IsList { get; }
Property Value
MemberInfo
Gets association member (field, property or method).
public MemberInfo MemberInfo { get; }
Property Value
OtherKey
Gets list of names of to (other) key members. Could be empty, if association has predicate expression.
public string[] OtherKey { get; }
Property Value
- string[]
Predicate
Gets optional predicate expression.
public Expression? Predicate { get; }
Property Value
Storage
Gets optional association value storage field or property name. Used with LoadWith.
public string? Storage { get; }
Property Value
ThisKey
Gets list of names of from (this) key members. Could be empty, if association has predicate expression.
public string[] ThisKey { get; }
Property Value
- string[]
Methods
GenerateAlias()
Generates table alias for association.
public string GenerateAlias()
Returns
- string
Generated alias.
GetElementType(MappingSchema)
public Type GetElementType(MappingSchema mappingSchema)
Parameters
mappingSchema
MappingSchema
Returns
GetParentElementType()
public Type GetParentElementType()
Returns
GetPredicate(Type, Type)
Loads predicate expression from ExpressionPredicate member.
public LambdaExpression? GetPredicate(Type parentType, Type objectType)
Parameters
parentType
TypeType of object that declares association
objectType
TypeType of object associated with expression predicate
Returns
- LambdaExpression
null
of association has no custom predicate expression or predicate expression, specified by ExpressionPredicate member.
GetQueryMethod(Type, Type)
Loads query method expression from ExpressionQueryMethod member.
public LambdaExpression? GetQueryMethod(Type parentType, Type objectType)
Parameters
parentType
TypeType of object that declares association
objectType
TypeType of object associated with query method expression
Returns
- LambdaExpression
null
of association has no custom query method expression or query method expression, specified by ExpressionQueryMethod member.
HasQueryMethod()
public bool HasQueryMethod()
Returns
ParseKeys(string?)
Parse comma-separated list of association key column members into string array.
public static string[] ParseKeys(string? keys)
Parameters
keys
stringComma-separated (spaces allowed) list of association key column members.
Returns
- string[]
Returns array with names of association key column members.