Пример #1
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n");
            this.Write("\r\nvar beginTransactionX = new Twenty57.Linx.Components.Database.BeginTransaction." +
                       "BeginTransactionX(\r\n\t");

            #line 12 "D:\Hg\Linx5 Components\Database\Code\Database\BeginTransaction\BeginTransaction_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(ConnectionType)));

            #line default
            #line hidden
            this.Write(",\r\n\t");

            #line 13 "D:\Hg\Linx5 Components\Database\Code\Database\BeginTransaction\BeginTransaction_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(ConnectionStringPropertyName));

            #line default
            #line hidden
            this.Write(",\r\n\tSystem.Data.IsolationLevel.");

            #line 14 "D:\Hg\Linx5 Components\Database\Code\Database\BeginTransaction\BeginTransaction_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(IsolationLevelName));

            #line default
            #line hidden
            this.Write(");\r\nbeginTransactionX.Transaction.LogEvent += message => ");

            #line 15 "D:\Hg\Linx5 Components\Database\Code\Database\BeginTransaction\BeginTransaction_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FunctionContextProperty));

            #line default
            #line hidden
            this.Write(".Log(message);\r\n");

            #line 16 "D:\Hg\Linx5 Components\Database\Code\Database\BeginTransaction\BeginTransaction_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(ExecutionPathOutputName));

            #line default
            #line hidden
            this.Write(" = beginTransactionX.Select(transaction => new Twenty57.Linx.Plugin.Common.CodeGe" +
                       "neration.NextResult(");

            #line 16 "D:\Hg\Linx5 Components\Database\Code\Database\BeginTransaction\BeginTransaction_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(ExecutionPathName)));

            #line default
            #line hidden
            this.Write(", transaction));\r\n");
            return(this.GenerationEnvironment.ToString());
        }
Пример #2
0
        public override void GenerateCode(IFunctionBuilder functionBuilder)
        {
            bool isText = FunctionData.Properties[FileOpenShared.IsTextPropertyName].GetValue <bool>();

            functionBuilder.AddCode(string.Format(
                                        @"var fileOpenX = new Twenty57.Linx.Components.File.FileOpen.FileOpenX({0}, {1}, {2}, {3}, {4}, message => {5}.Log(message));
			{6} = fileOpenX.Select(fileHandle => new Twenty57.Linx.Plugin.Common.CodeGeneration.NextResult({7}, new {8} {{ {9} = fileOpenX.FilePath, {10} = ({11})fileHandle }}));
			return fileOpenX.FilePath;"            ,
                                        functionBuilder.GetParamName(FileOpenShared.FilePathPropertyName),
                                        CSharpUtilities.BoolAsString(isText),
                                        CSharpUtilities.EnumAsString(FunctionData.Properties[FileOpenShared.CodepagePropertyName].Value),
                                        CSharpUtilities.EnumAsString(FunctionData.Properties[FileOpenShared.FileDoesNotExistPropertyName].Value),
                                        CSharpUtilities.EnumAsString(FunctionData.Properties[FileOpenShared.FileExistsPropertyName].Value),
                                        functionBuilder.ContextParamName,
                                        functionBuilder.ExecutionPathOutParamName,
                                        CSharpUtilities.ToVerbatimString(FileOpenShared.ExecutionPathName),
                                        functionBuilder.GetTypeName(FunctionData.ExecutionPaths[FileOpenShared.ExecutionPathName].Output),
                                        FileOpenShared.OutputFilePathPropertyName,
                                        FileOpenShared.OutputFileHandlePropertyName,
                                        (isText ? typeof(TextFileHandle) : typeof(BinaryFileHandle)).FullName));

            functionBuilder.AddAssemblyReference(typeof(FileOpenX));
        }
Пример #3
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n");
            this.Write("\r\n");
            this.Write("\r\n");
            this.Write("\r\n");

            #line 22 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            string lengthList = "";
            foreach (var field in fields.FieldList)
            {
                lengthList += field.Length + ",";
            }
            lengthList = lengthList.Substring(0, lengthList.Length - 1);


            #line default
            #line hidden
            this.Write("\r\nvar fieldParser = new Twenty57.Linx.Components.File.TextFileRead.FieldParser(\r\n" +
                       "\t\t");

            #line 29 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(fields.TextFileType)));

            #line default
            #line hidden
            this.Write(",\r\n\t\t");

            #line 30 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(fields.Delimiter)));

            #line default
            #line hidden
            this.Write(",\r\n\t\t");

            #line 31 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(fields.TextQualifier)));

            #line default
            #line hidden
            this.Write(",\r\n\t\t");

            #line 32 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(fields.OtherDelimiter)));

            #line default
            #line hidden
            this.Write(",\r\n\t\t");

            #line 33 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(lengthList)));

            #line default
            #line hidden
            this.Write(");\r\nFunc<Twenty57.Linx.Components.File.TextFileRead.TextFileReader.NextString,");

            #line 34 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(pathOutputTypeName));

            #line default
            #line hidden
            this.Write("> parseField = (nextLine)=> \r\n{\r\n\tif(nextLine != null)\r\n\t{\r\n\t\tvar parsedFields = " +
                       "fieldParser.GetValues(nextLine.LineContents);\r\n\t\tvar record = new ");

            #line 39 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(pathOutputTypeName));

            #line default
            #line hidden
            this.Write("();\r\n\t\tvar recordInner = new ");

            #line 40 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(recordInnerTypeName));

            #line default
            #line hidden
            this.Write("();\r\n\t\trecord.");

            #line 41 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(outputLineNumberName));

            #line default
            #line hidden
            this.Write(" = nextLine.LineNumber;\r\n\t\t");

            #line 42 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"

            int index = 0;
            foreach (var field in fields.FieldList)
            {
                if (!field.Skip)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\tif(");

            #line 48 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(index));

            #line default
            #line hidden
                    this.Write(" < parsedFields.Length)\r\n\t\t\t\t{\r\n\t\t\t\t\t");

            #line 50 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                    if (field.Type.Is(typeof(DateTime)) && !String.IsNullOrWhiteSpace(field.Format))
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t\t\trecordInner.");

            #line 51 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write(" = DateTime.ParseExact(parsedFields[");

            #line 51 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(index));

            #line default
            #line hidden
                        this.Write("], \"");

            #line 51 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Format));

            #line default
            #line hidden
                        this.Write("\", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTi" +
                                   "meStyles.None);\r\n\t\t\t\t\t");

            #line 52 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                    }
                    else if (field.Type.Is(typeof(decimal)) || (field.Type.Is(typeof(double))))
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t\t\trecordInner.");

            #line 53 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write(" = ");

            #line 53 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Type.GetGeneratedType()));

            #line default
            #line hidden
                        this.Write(".Parse(parsedFields[");

            #line 53 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(index));

            #line default
            #line hidden
                        this.Write("], System.Globalization.CultureInfo.InvariantCulture);\r\n\t\t\t\t\t");

            #line 54 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write(" \r\n\t\t\t\t\trecordInner.");

            #line 55 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write(" = (");

            #line 55 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Type.GetGeneratedType()));

            #line default
            #line hidden
                        this.Write(")Convert.ChangeType(parsedFields[");

            #line 55 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(index));

            #line default
            #line hidden
                        this.Write("], typeof(");

            #line 55 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Type.GetGeneratedType()));

            #line default
            #line hidden
                        this.Write("));\r\n\t\t\t\t\t");

            #line 56 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                    }

            #line default
            #line hidden
                    this.Write("\t\t\t\t}\r\n\t\t");

            #line 58 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
                }
                index++;
            }

            #line default
            #line hidden
            this.Write("\t\trecord.");

            #line 61 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(recordInnerMemberName));

            #line default
            #line hidden
            this.Write(" = recordInner;\r\n\t\treturn record;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn null;\r\n\t}\r\n};\r\n\r\nvar f" +
                       "ileHandle = (Twenty57.Linx.Components.File.Common.TextFileHandle)");

            #line 70 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(filePathPropertyName));

            #line default
            #line hidden
            this.Write(";\r\nfileHandle.LogEvent += message => ");

            #line 71 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(functionContextPropertyName));

            #line default
            #line hidden
            this.Write(".Log(message);\r\nvar reader = new Twenty57.Linx.Components.File.TextFileRead.TextF" +
                       "ileReader(\r\n\tfileHandle, \r\n\t");

            #line 74 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(readType)));

            #line default
            #line hidden
            this.Write(", \r\n\t");

            #line 75 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(codePage)));

            #line default
            #line hidden
            this.Write(", \r\n\t");

            #line 76 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(skipHeaderLines));

            #line default
            #line hidden
            this.Write(",\r\n\t");

            #line 77 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(skipFooterLines));

            #line default
            #line hidden
            this.Write("\r\n\t);\r\nreader.LogEvent += message => ");

            #line 79 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(functionContextPropertyName));

            #line default
            #line hidden
            this.Write(".Log(message);\r\n");

            #line 80 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(executionPathOutputName));

            #line default
            #line hidden
            this.Write(" = reader.Lines().Select(v=> new Twenty57.Linx.Plugin.Common.CodeGeneration.NextR" +
                       "esult(\"");

            #line 80 "C:\Projects\Linx\linx5-components\linx5-components-file\Code\File\TextFileRead\Templates\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(resultsExecutionPathName));

            #line default
            #line hidden
            this.Write("\", parseField(v)));\r\n");
            return(this.GenerationEnvironment.ToString());
        }
Пример #4
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n");
            this.Write("\r\nvar OutputNames = ");

            #line 23 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ArrayAsString(ResultTypeFields.Select(x => x.Name))));

            #line default
            #line hidden
            this.Write(";\r\nvar ColumnNames = ");

            #line 24 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ArrayAsString(ResultTypeFields.Select(x => x.ColumnName))));

            #line default
            #line hidden
            this.Write(";\r\nvar SqlIdentifiers = ");

            #line 25 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SqlIdentifiers));

            #line default
            #line hidden
            this.Write(";\r\nvar SqlValues = ");

            #line 26 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SqlValues));

            #line default
            #line hidden
            this.Write(";\r\n\r\nvar executeSqlX = new Twenty57.Linx.Components.Database.ExecuteSQL.ExecuteSQ" +
                       "LX(\r\n");

            #line 29 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            if (UseTransaction)
            {
            #line default
            #line hidden

            #line 30 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TransactionProperty));

            #line default
            #line hidden
                this.Write(".GetConnectionType(), ");

            #line 30 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TransactionProperty));

            #line default
            #line hidden
                this.Write(".GetDbTransaction(), \r\n");

            #line 31 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            }
            else
            {
            #line default
            #line hidden

            #line 32 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(ConnectionType)));

            #line default
            #line hidden
                this.Write(", ");

            #line 32 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(ConnectionStringProperty));

            #line default
            #line hidden
                this.Write(", \r\n");

            #line 33 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            }

            #line default
            #line hidden

            #line 34 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Timeout));

            #line default
            #line hidden
            this.Write(", OutputNames, ColumnNames, ");

            #line 34 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Sql));

            #line default
            #line hidden
            this.Write(", SqlIdentifiers, SqlValues);\r\nexecuteSqlX.LogEvent += message => ");

            #line 35 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FunctionContextProperty));

            #line default
            #line hidden
            this.Write(".Log(message);\r\n\r\n");

            #line 37 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            if (RowType != null)
            {
            #line default
            #line hidden
                this.Write("\r\nvar rowBuilder = new System.Func<");

            #line 39 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(RowTypeName));

            #line default
            #line hidden
                this.Write(">(() => {\r\n\t");

            #line 40 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                var rowFields       = ResultTypeFields.Where(f => !string.IsNullOrEmpty(f.Name));
                var logFormatString = "Retrieved ";
                int index           = 0;
                foreach (var nextField in rowFields)
                {
                    logFormatString += string.Format("{0} = {{{1}}}, ", nextField.ColumnName, index++);
                }


            #line default
            #line hidden
                this.Write("\t");

            #line 46 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FunctionContextProperty));

            #line default
            #line hidden
                this.Write(".Log(System.String.Format(");

            #line 46 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(logFormatString.TrimEnd(',', ' '))));

            #line default
            #line hidden
                this.Write("\r\n\t");

            #line 47 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                foreach (var nextField in rowFields)
                {
            #line default
            #line hidden
                    this.Write("\t\t, Twenty57.Linx.Components.Database.Common.LogHelpers.GetDisplayString(executeS" +
                               "qlX.Reader[");

            #line 48 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(nextField.ColumnName)));

            #line default
            #line hidden
                    this.Write("])\r\n\t");

            #line 49 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                }

            #line default
            #line hidden
                this.Write("\t));\r\n\r\n\treturn new ");

            #line 52 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(RowTypeName));

            #line default
            #line hidden
                this.Write("\r\n\t{\r\n\t\t");

            #line 54 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                foreach (var nextField in rowFields)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t");

            #line 55 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(GetParamName(nextField.Name)));

            #line default
            #line hidden
                    this.Write(" = Twenty57.Linx.Components.Database.ExecuteSQL.DatabaseHelpers.CheckDbValue<");

            #line 55 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(Twenty57.Linx.Components.Database.Common.TypeHelpers.GetCodeStringForType(nextField.TypeReference)));

            #line default
            #line hidden
                    this.Write(">(executeSqlX.Reader[");

            #line 55 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(nextField.ColumnName)));

            #line default
            #line hidden
                    this.Write("]), \r\n\t\t");

            #line 56 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                }

            #line default
            #line hidden
                this.Write("\t};\r\n});\r\n\r\n");

            #line 60 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                if (ReturnMode == ExecuteSQLShared.ReturnModeType.ListOfRows)
                {
            #line default
            #line hidden
                    this.Write("try\r\n{\r\n\texecuteSqlX.OpenReader();\r\n\r\n\tvar table = new List<");

            #line 65 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(RowTypeName));

            #line default
            #line hidden
                    this.Write(">();\r\n\twhile (executeSqlX.Reader.Read())\r\n\t\ttable.Add(rowBuilder());\r\n\treturn tab" +
                               "le;\r\n}\r\nfinally\r\n{\r\n\texecuteSqlX.Dispose();\r\n}\r\n");

            #line 74 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                }
                else if ((ReturnMode == ExecuteSQLShared.ReturnModeType.FirstRow) || (ReturnMode == ExecuteSQLShared.ReturnModeType.FirstRowElseEmptyRow))
                {
            #line default
            #line hidden
                    this.Write("try\r\n{\r\n\texecuteSqlX.OpenReader();\r\n\r\n\t");

            #line 79 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(RowTypeName));

            #line default
            #line hidden
                    this.Write(" row;\r\n\tif (executeSqlX.Reader.Read())\r\n\t\trow = rowBuilder();\r\n\telse\r\n\t{\r\n\t\t");

            #line 84 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    if (ReturnMode == ExecuteSQLShared.ReturnModeType.FirstRow)
                    {
            #line default
            #line hidden
                        this.Write("\t\tthrow new Exception(\"No rows returned by query.\");\r\n\t\t");

            #line 86 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write("\t\trow = new ");

            #line 87 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(RowTypeName));

            #line default
            #line hidden
                        this.Write("();\r\n\t\t");

            #line 88 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    }

            #line default
            #line hidden
                    this.Write("\t}\r\n\r\n\treturn row;\r\n}\r\nfinally\r\n{\r\n\texecuteSqlX.Dispose();\r\n}\r\n");

            #line 97 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write("executeSqlX.OpenReader();\r\n");

            #line 99 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(ExecutionPathOutputName));

            #line default
            #line hidden
                    this.Write(" = \r\nexecuteSqlX.Rows<Twenty57.Linx.Plugin.Common.CodeGeneration.NextResult>(read" +
                               "er => {\r\n\tvar row = rowBuilder();\r\n\treturn new Twenty57.Linx.Plugin.Common.CodeG" +
                               "eneration.NextResult(\"");

            #line 102 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(ExecutionPathName));

            #line default
            #line hidden
                    this.Write("\", row);\r\n});\r\n");

            #line 104 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
                }

            #line default
            #line hidden

            #line 105 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            }
            else
            {
            #line default
            #line hidden
                this.Write("try\r\n{\r\n\texecuteSqlX.OpenReader();\r\n}\r\nfinally\r\n{\r\n\texecuteSqlX.Dispose();\r\n}\r\n");

            #line 114 "D:\Hg\Linx5 Components\Database\Code\Database\ExecuteSQL\ExecuteSQL_Gen.tt"
            }

            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
Пример #5
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n");
            this.Write("\r\n");
            this.Write("\r\n\r\nvar bulkCopier = new Twenty57.Linx.Components.Database.DbBulkCopy.Runtime.DbB" +
                       "ulkCopierX(\r\n\t");

            #line 19 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.EnumAsString(ConnectionType)));

            #line default
            #line hidden
            this.Write(", ");

            #line 19 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(ConnectionStringProperty));

            #line default
            #line hidden
            this.Write(", ");

            #line 19 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(TableName)));

            #line default
            #line hidden
            this.Write("\r\n");

            #line 20 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            foreach (var nextColumnName in ColumnNames)
            {
            #line default
            #line hidden
                this.Write(", ");

            #line 21 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(nextColumnName)));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 22 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            }

            #line default
            #line hidden
            this.Write(");\r\nbulkCopier.Timeout = ");

            #line 23 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Timeout));

            #line default
            #line hidden
            this.Write(";\r\nbulkCopier.BatchSize = ");

            #line 24 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(BatchSize));

            #line default
            #line hidden
            this.Write(";\r\nbulkCopier.LogEvent += message => ");

            #line 25 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FunctionContextProperty));

            #line default
            #line hidden
            this.Write(".Log(message);\r\n\r\nvar makeRow = new System.Func<dynamic, object[]>(row => {\r\n\tobj" +
                       "ect[] columns = new object[");

            #line 28 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(ColumnPropertyNames.Length));

            #line default
            #line hidden
            this.Write("];\r\n\t");

            #line 29 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            for (int i = 0; i < ColumnPropertyNames.Length; i++)
            {
            #line default
            #line hidden
                this.Write("\tcolumns[");

            #line 30 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(i));

            #line default
            #line hidden
                this.Write("] = \r\n\t\t");

            #line 31 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                if (ColumnDataTypes[i] == Twenty57.Linx.Components.Database.Common.DatabaseModel.DataType.Binary)
                {
            #line default
            #line hidden
                    this.Write("\t\trow.");

            #line 32 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(ColumnPropertyNames[i]));

            #line default
            #line hidden
                    this.Write(" == null ? null : row.");

            #line 32 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(ColumnPropertyNames[i]));

            #line default
            #line hidden
                    this.Write(".ToArray();\r\n\t\t");

            #line 33 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write("\t\trow.");

            #line 34 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(ColumnPropertyNames[i]));

            #line default
            #line hidden
                    this.Write(";\r\n\t\t");

            #line 35 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
                }

            #line default
            #line hidden
                this.Write("\t");

            #line 36 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            }

            #line default
            #line hidden
            this.Write("\treturn columns;\r\n});\r\n\r\nbulkCopier.Start();\r\n");

            #line 41 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(ExecutionPathOutputName));

            #line default
            #line hidden
            this.Write(" = Twenty57.Linx.Components.Database.DbBulkCopy.Runtime.SingleEnumerable.Make(\r\n\t" +
                       "new Twenty57.Linx.Components.Database.DbBulkCopy.Runtime.Loader(bulkCopier, make" +
                       "Row))\r\n\t.Select(l => new Twenty57.Linx.Plugin.Common.CodeGeneration.NextResult(");

            #line 43 "D:\Hg\Linx5 Components\Database\Code\Database\DbBulkCopy\DbBulkCopy_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(ExecutionPathName)));

            #line default
            #line hidden
            this.Write(", l));\r\n");
            return(this.GenerationEnvironment.ToString());
        }
Пример #6
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n");
            this.Write("\r\n");
            this.Write("\r\n");

            #line 20 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            string lengthList = "";

            foreach (var field in fields.FieldList)
            {
                lengthList += field.Length + ",";
            }

            lengthList = lengthList.Substring(0, lengthList.Length - 1);

            #line default
            #line hidden
            this.Write("\r\nvar fileReadX = new Twenty57.Linx.Components.File.TextFileReadX(\r\n\t");

            #line 28 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(filePath));

            #line default
            #line hidden
            this.Write(", \r\n\tTwenty57.Linx.Components.File.FileReadOptions.");

            #line 29 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(readType));

            #line default
            #line hidden
            this.Write(", \r\n\tTwenty57.Linx.Components.File.TextCodepage.");

            #line 30 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(codePage));

            #line default
            #line hidden
            this.Write(", \r\n\t");

            #line 31 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(retryInterval));

            #line default
            #line hidden
            this.Write(", \r\n\t");

            #line 32 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(retryTimes));

            #line default
            #line hidden
            this.Write(",\r\n\t");

            #line 33 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(skipHeaderLines));

            #line default
            #line hidden
            this.Write(",\r\n\t");

            #line 34 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(skipFooterLines));

            #line default
            #line hidden
            this.Write(",\r\n\tTwenty57.Linx.Components.File.FileType.");

            #line 35 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(fields.TextFileType.ToString()));

            #line default
            #line hidden
            this.Write(",\r\n\tTwenty57.Linx.Components.File.DelimiterType.");

            #line 36 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(fields.Delimiter.ToString()));

            #line default
            #line hidden
            this.Write(",\r\n\tTwenty57.Linx.Components.File.TextQualifierType.");

            #line 37 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(fields.TextQualifier.ToString()));

            #line default
            #line hidden
            this.Write(",\r\n\t");

            #line 38 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(fields.OtherDelimiter)));

            #line default
            #line hidden
            this.Write(",\r\n\t");

            #line 39 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CSharpUtilities.ToVerbatimString(lengthList)));

            #line default
            #line hidden
            this.Write(");\r\n\r\nfileReadX.InitializeLineByLine();\r\n\t\t\t\t\t\t\r\nFunc<INextResult> getNextFunctio" +
                       "n = () => \r\n{\r\n\tvar nextLine = fileReadX.Next();\r\n\tif(nextLine != null)\r\n\t{\r\n\t\tv" +
                       "ar parsedFields = fileReadX.GetValues(nextLine.LineContents);\r\n\t\tvar record = ne" +
                       "w ");

            #line 49 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(pathOutputTypeName));

            #line default
            #line hidden
            this.Write("();\r\n\t\tvar recordInner = new ");

            #line 50 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(recordInnerTypeName));

            #line default
            #line hidden
            this.Write("();\r\n\t\trecord.");

            #line 51 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(outputLineNumberName));

            #line default
            #line hidden
            this.Write(" = nextLine.LineNumber;\r\n\t\t");

            #line 52 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"

            int index = 0;
            foreach (var field in fields.FieldList)
            {
                if (!field.Skip)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\tif(");

            #line 58 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(index));

            #line default
            #line hidden
                    this.Write(" < parsedFields.Length)\r\n\t\t\t\t{\r\n\t\t\t\t\t");

            #line 60 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                    if (field.Type.Is(typeof(DateTime)) && !String.IsNullOrWhiteSpace(field.Format))
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t\t\trecordInner.");

            #line 61 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write(" = DateTime.ParseExact(parsedFields[");

            #line 61 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(index));

            #line default
            #line hidden
                        this.Write("], \"");

            #line 61 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Format));

            #line default
            #line hidden
                        this.Write("\", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTi" +
                                   "meStyles.None);\r\n\t\t\t\t\t");

            #line 62 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write(" \r\n\t\t\t\t\trecordInner.");

            #line 63 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write(" = (");

            #line 63 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Type.GetGeneratedType()));

            #line default
            #line hidden
                        this.Write(")Convert.ChangeType(parsedFields[");

            #line 63 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(index));

            #line default
            #line hidden
                        this.Write("], typeof(");

            #line 63 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Type.GetGeneratedType()));

            #line default
            #line hidden
                        this.Write("));\r\n\t\t\t\t\t");

            #line 64 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                    }

            #line default
            #line hidden
                    this.Write("\t\t\t\t}\r\n\t\t");

            #line 66 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
                }
                index++;
            }

            #line default
            #line hidden
            this.Write("\t\trecord.");

            #line 69 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(recordInnerMemberName));

            #line default
            #line hidden
            this.Write(" = recordInner;\r\n\t\treturn new NextResult(\r\n\t\t\t\"");

            #line 71 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(resultsExecutionPathName));

            #line default
            #line hidden
            this.Write("\", \r\n\t\t\trecord);\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn null;\r\n\t}\r\n};\r\n\r\nreturn new ExecuteResu" +
                       "lt(\r\n\tnew ");

            #line 81 "C:\Users\murray.long\Documents\Workspace\Linx5\Components\File\Code\File\TextFileRead\TextFileReadFieldsAndLoop_Gen.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(outputTypeName));

            #line default
            #line hidden
            this.Write(" { },\r\n\tgetNextFunction); \r\n");
            return(this.GenerationEnvironment.ToString());
        }