//public void Init<TOther, TKey, TOtherKey>(Expression<Func<T, IEnumerable<TOther>>> prop, Expression<Func<T, TKey>> thisKeyExpression, Expression<Func<TOther, TOtherKey>> otherKeyExpression, OrmJoinType joinType = OrmJoinType.Left) { // var predicateExpression = Expression.Lambda<Func<T, TOther, bool>>(Expression.Equal(thisKeyExpression.Body, otherKeyExpression.Body)); // Init(prop, predicateExpression, joinType); //} public void Init <TOther>(Expression <Func <T, TOther> > prop, Expression <Func <T, TOther, bool> > predicate, OrmJoinType joinType = OrmJoinType.Inner) { JoinType = joinType; PropertyExpression = prop; PredicateExpression = predicate; Type2 = typeof(TOther); //Relationship = OrmRelationship.ManyToOne; //PropertyExpressionFunc = GetObjectPropertyExpression(prop); //PredicateExpressionFunc = GetObjectPredicateExpressionFunc(predicate); }
//public OrmRelationship Relationship { get; set; } public void Init <TOther>(Expression <Func <T, IEnumerable <TOther> > > prop, Expression <Func <T, TOther, bool> > predicate, OrmJoinType joinType = OrmJoinType.Left) { JoinType = joinType; PropertyExpression = prop; PredicateExpression = predicate; Type2 = typeof(TOther); //Relationship = OrmRelationship.OneToMany; //PropertyExpressionFunc = GetObjectPropertyExpression(prop); //PredicateExpressionFunc = GetObjectPredicateExpressionFunc(predicate); }
public static void AddToAssociationJoins_NotUsedYet <T, TOther>(this xIOrmClass <T> ormClass, Expression <Func <T, IEnumerable <TOther> > > propertyExpression, Expression <Func <T, TOther, bool> > predicateExpression, OrmJoinType joinType = OrmJoinType.Left) where T : class { var name = GetName(propertyExpression); var joinClause = new OrmJoinClause <T>(); joinClause.Init(propertyExpression, predicateExpression, joinType); ormClass.AssociationJoins_NotUsedYet.Add(name, joinClause); }
public static OrmJoinTypeEnumClass GetEnumClass(this OrmJoinType o) { return(new OrmJoinTypeEnumClass { CanBeNull = !(new[] { OrmJoinType.Inner }.Contains(o)) }); }