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

            foreach (var member in members)
            {
                Expression genId   = this.translator.Linguist.Language.GetGeneratedIdExpression(member);
                var        name    = member.Name;
                var        colType = this.GetColumnType(entity, member);
                columns.Add(new ColumnDeclaration(member.Name, genId, colType));
                decls.Add(new VariableDeclaration(member.Name, colType, new ColumnExpression(genId.Type, colType, alias, member.Name)));
                if (map != null)
                {
                    var vex = new VariableExpression(member.Name, TypeHelper.GetMemberType(member), colType);
                    map.Add(member, vex);
                }
            }
            var select = new SelectExpression(alias, columns, null, null);

            return(new DeclarationCommand(decls, select));
        }
Exemplo n.º 2
0
 protected virtual Expression VisitVariable(VariableExpression vex) => vex;
 protected virtual Expression VisitVariable(VariableExpression vex)
 {
     return(vex);
 }
Exemplo n.º 4
0
 protected override Expression VisitVariable(VariableExpression vex)
 {
     this.WriteVariableName(vex.Name);
     return(vex);
 }
 protected virtual Expression VisitVariable(VariableExpression vex)
 {
     this.Write(this.FormatQuery(vex));
     return(vex);
 }