Beispiel #1
0
        private void Join(GenericWhereEntity <TA> TA, GenericWhereEntity <TB> TB,
                          Expression <Func <TA, TB, bool> > conditionExpression, JoinModeEnum joinMode)
        {
            if (conditionExpression.Body == null)
            {
                throw new EntitySqlException("未指定连接条件!");
            }
            if (!(conditionExpression.Body is BinaryExpression) || !CheckJoinCondition(conditionExpression.Body))
            {
                throw new EntitySqlException("指定的连接条件无效!");
            }

            JoinMode                    = joinMode;
            MainEntity                  = TA;
            EntityToJoin                = TB;
            LeftTableGuid               = TA.Guid;
            RightTableGuid              = TB.Guid;
            JoinConditionExpression     = conditionExpression.Body;
            JoinConditionFirstParameter = conditionExpression.Parameters[0].Name;
        }
Beispiel #2
0
 public void LeftJoin(GenericWhereEntity <TA> TA, GenericWhereEntity <TB> TB,
                      Expression <Func <TA, TB, bool> > conditionExpression)
 {
     Join(TA, TB, conditionExpression, JoinModeEnum.LeftJoin);
 }