Beispiel #1
0
        public virtual StringBuilder BuildSelectColumns(IObjectMapInfo map)
        {
            StringBuilder b = new StringBuilder();

            foreach (var pmi in map.PropertyMaps)
            {
                b.Append(_tr.GetEscapedColumnName(pmi.ColumnName)).Append(_tr.ColumnDelimiter);
            }
            b.RemoveEnd(_tr.ColumnDelimiter);
            return(b);
        }
 protected override Expression VisitMember(MemberExpression m)
 {
     if (m.Expression != null && m.Expression.NodeType == ExpressionType.Parameter)
     {
         string colName = _map.GetColumnFromProperty(m.Member.Name);
         _str.Append(_tr.GetEscapedColumnName(colName));
         return(m);
     }
     ParseExceptionHelper.ThrowNotSupportedExpression(m);
     return(m);
 }
        private void Visit(SingleEntityView s)
        {
            var map = _cache.GetMapInfo(s.EntityType, true);

            string prefix = s.Alias ?? map.Table.LocalName;

            foreach (var pMap in map.PropertyMaps)
            {
                _str.Append(_tr.GetEscapedTableName(prefix)).Append(_tr.MemberAccess).Append(_tr.GetEscapedColumnName(pMap.ColumnName))
                .Append(_tr.As).Append(_tr.GetEscapedColumnName(prefix + pMap.ColumnName)).Append(_tr.ColumnDelimiter);
            }
        }
 protected override Expression VisitMember(MemberExpression node)
 {
     if (node.NodeType == ExpressionType.MemberAccess)
     {
         _str.Append(_tr.GetEscapedColumnName(_map.GetColumnFromProperty(node.Member.Name)));
     }
     else
     {
         ParseExceptionHelper.ThrowNotSupportedExpression(node);
     }
     return(node);
 }
        protected override Expression VisitMember(MemberExpression m)
        {
            if (m.Expression != null && m.Expression.NodeType == ExpressionType.Parameter)
            {
                Visit(m.Expression);

                var map = _cache.GetMapInfo(m.Expression.Type, true);
                _str.Append(_tr.MemberAccess);
                string colName = map.GetColumnFromProperty(m.Member.Name);
                _str.Append(_tr.GetEscapedColumnName(colName));
                return(m);
            }
            ParseExceptionHelper.ThrowNotSupportedExpression(m);
            return(m);
        }