Exemplo n.º 1
0
        protected virtual DeclarationCommand GetGeneratedIdCommand(MappingEntity entity, List <MemberInfo> members, Dictionary <MemberInfo, Expression> map)
        {
            List <ColumnDeclaration>   columns   = new List <ColumnDeclaration>();
            List <VariableDeclaration> variables = new List <VariableDeclaration>();
            TableAlias alias = new TableAlias();

            foreach (MemberInfo info in members)
            {
                Expression generatedIdExpression = this.translator.Linguist.Language.GetGeneratedIdExpression(info);
                string     name       = info.Name;
                QueryType  columnType = this.GetColumnType(entity, info);
                columns.Add(new ColumnDeclaration(info.Name, generatedIdExpression, columnType));
                variables.Add(new VariableDeclaration(info.Name, columnType, new ColumnExpression(generatedIdExpression.Type, columnType, alias, info.Name)));
                if (map != null)
                {
                    VariableExpression expression2 = new VariableExpression(info.Name, King.Framework.Linq.TypeHelper.GetMemberType(info), columnType);
                    map.Add(info, expression2);
                }
            }
            return(new DeclarationCommand(variables, new SelectExpression(alias, columns, null, null)));
        }
Exemplo n.º 2
0
 protected override Expression VisitVariable(VariableExpression vex)
 {
     this.WriteVariableName(vex.Name);
     return(vex);
 }
Exemplo n.º 3
0
 protected virtual Expression VisitVariable(VariableExpression vex)
 {
     base.Write(this.FormatQuery(vex));
     return(vex);
 }
Exemplo n.º 4
0
 protected virtual Expression VisitVariable(VariableExpression vex)
 {
     return(vex);
 }