Exemple #1
0
        IMappingObjectExpression VisistMapTypeSelector(Expression exp)
        {
            if (!MappingTypeSystem.IsMappingType(exp.Type))
            {
                throw new NotSupportedException(exp.ToString());
            }

            DbExpression           dbExp = this.VisistExpression(exp);
            MappingFieldExpression ret   = new MappingFieldExpression(exp.Type, dbExp);

            return(ret);
        }
        public IMappingObjectExpression ToNewObjectExpression(DbSqlQueryExpression sqlQuery, DbTable table)
        {
            DbColumnAccessExpression cae = null;

            cae = MappingObjectExpressionHelper.ParseColumnAccessExpression(sqlQuery, table, this._exp);

            MappingFieldExpression mf = new MappingFieldExpression(this._type, cae);

            mf.NullChecking = MappingObjectExpressionHelper.TryGetOrAddNullChecking(sqlQuery, table, this.NullChecking);

            return(mf);
        }
Exemple #3
0
        /// <summary>
        /// a => a.Id   a => a.Name   a => a.User
        /// </summary>
        /// <param name="exp"></param>
        /// <returns></returns>
        protected override IMappingObjectExpression VisitMemberAccess(MemberExpression exp)
        {
            //create MappingFieldExpression object if exp is map type
            if (MappingTypeSystem.IsMappingType(exp.Type))
            {
                DbExpression           dbExp = this.VisistExpression(exp);
                MappingFieldExpression ret   = new MappingFieldExpression(exp.Type, dbExp);
                return(ret);
            }

            //如 a.Order a.User 等形式
            return(this.VisitNavigationMember(exp));
        }