예제 #1
0
        //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);
        }
예제 #2
0
        //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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 public static OrmJoinTypeEnumClass GetEnumClass(this OrmJoinType o)
 {
     return(new OrmJoinTypeEnumClass {
         CanBeNull = !(new[] { OrmJoinType.Inner }.Contains(o))
     });
 }