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)); }
protected virtual Expression VisitVariable(VariableExpression vex) => vex;
protected virtual Expression VisitVariable(VariableExpression vex) { return(vex); }
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); }