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
typeTypeFrom (this) side entity mapping type.
memberInfoMemberInfoAssociation member (field, property or method).
thisKeystring[]List of names of from (this) key members.
otherKeystring[]List of names of to (other) key members.
expressionPredicatestringOptional predicate expression source property or method.
predicateExpressionOptional predicate expression.
expressionQueryMethodstringOptional name of query method.
expressionQueryExpressionOptional query expression.
storagestringOptional association value storage field or property name.
associationSetterExpressionMethodstringOptional name of setter method.
associationSetterExpressionExpressionOptional setter expression.
canBeNullbool?If
true, association will generate outer join, otherwise - inner join.aliasNamestringOptional 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
mappingSchemaMappingSchema
Returns
GetParentElementType()
public Type GetParentElementType()
Returns
GetPredicate(Type, Type)
Loads predicate expression from ExpressionPredicate member.
public LambdaExpression? GetPredicate(Type parentType, Type objectType)
Parameters
parentTypeTypeType of object that declares association
objectTypeTypeType of object associated with expression predicate
Returns
- LambdaExpression
nullof 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
parentTypeTypeType of object that declares association
objectTypeTypeType of object associated with query method expression
Returns
- LambdaExpression
nullof 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
keysstringComma-separated (spaces allowed) list of association key column members.
Returns
- string[]
Returns array with names of association key column members.