/// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n");

            #line 21 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"

            var swaggerParser = new SwaggerParser();


            #line default
            #line hidden
            this.Write("using System;\r\nusing System.Collections.Generic;\r\nusing System.Net.Http;\r\nusing S" +
                       "ystem.Threading.Tasks;\r\nusing System.Linq;\r\nusing Newtonsoft.Json;\r\nusing Swagge" +
                       "r2WebApiClient.Infrastructure;\r\nusing Swagger2WebApiClient.Models;\r\nusing ");

            #line 32 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Config.Namespace));

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

            #line 33 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Config.Namespace));

            #line default
            #line hidden
            this.Write(".Api;\r\nusing Refit;\r\n#region Models\r\nnamespace ");

            #line 36 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Config.Namespace));

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

            #line 38 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"

            var classDefinitions = ProxyDefinition.ClassDefinitions;
            foreach (var classDef in classDefinitions)
            {
                List <EnumDefinition> modelEnums = new List <EnumDefinition>();


            #line default
            #line hidden
                this.Write("\t/// <summary>\r\n\t/// \r\n\t/// </summary>\r\n\tpublic class ");

            #line 47 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(classDef.Name));

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

            #line 47 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(string.IsNullOrEmpty(classDef.Inherits) ? string.Empty : string.Format(": {0}", classDef.Inherits)));

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

            #line 49 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"

                foreach (var prop in classDef.Properties)
                {
            #line default
            #line hidden
                    this.Write("\r\n\t\tpublic ");

            #line 53 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(prop.TypeName));

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

            #line 53 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(prop.Name));

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

            #line 54 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"

                    if (prop.EnumValues != null)
                    {
                        modelEnums.Add(new EnumDefinition()
                        {
                            Name   = prop.TypeName,
                            Values = prop.EnumValues
                        });
                    }


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

            #line 64 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                }

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

            #line 66 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                foreach (var modelEnum in modelEnums)
                {
                    var csharpCodeProvider = new CSharpCodeProvider();


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

            #line 70 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(csharpCodeProvider.CreateValidIdentifier(modelEnum.Name)));

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

            #line 72 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    foreach (var value in modelEnum.Values.Distinct())
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t");

            #line 73 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(swaggerParser.FixTypeName(value)));

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

            #line 74 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    }

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

            #line 76 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                }

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

            #line 78 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
            }


            #line default
            #line hidden
            this.Write("\r\n}\r\n\r\n#endregion\r\n\r\n#region ApiClient\r\nnamespace ");

            #line 87 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Config.Namespace));

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

            #line 89 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"

            var proxies = ProxyDefinition.Operations.Select(i => i.ProxyName).Distinct();
            foreach (var proxy in proxies)
            {
            #line default
            #line hidden
                this.Write("\t/// <summary>\r\n\t/// Web Api Client For ");

            #line 95 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(swaggerParser.FixTypeName(proxy)));

            #line default
            #line hidden
                this.Write("\r\n\t/// </summary>\r\n\tpublic interface I");

            #line 97 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(swaggerParser.FixTypeName(proxy)));

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

            #line 99 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"

                List <EnumDefinition> proxyParamEnums = new List <EnumDefinition>();
                foreach (var operationDef in ProxyDefinition.Operations.Where(i => i.ProxyName.Equals(proxy)))
                {
                    string returnType = string.IsNullOrEmpty(operationDef.ReturnType) ? "Task" : string.Format("Task<{0}>", operationDef.ReturnType);
                    var    enums      = operationDef.Parameters.Where(i => i.Type.EnumValues != null);
                    if (enums != null)
                    {
                        foreach (var enumParam in enums)
                        {
                            enumParam.Type.TypeName = operationDef.OperationId + enumParam.Type.Name;
                            proxyParamEnums.Add(new EnumDefinition()
                            {
                                Name   = enumParam.Type.TypeName,
                                Values = enumParam.Type.EnumValues
                            });
                        }
                    }
                    operationDef.Parameters = operationDef.Parameters.OrderByDescending(i => i.IsRequired).ToList();
                    string parameters = string.Join(", ", operationDef.Parameters.Select(
                                                        x => (x.IsRequired == false) ? string.Format("{0}{1} {2} = {3}", swaggerParser.GetParameterType(x), swaggerParser.GetDefaultType(x), x.Type.GetCleanName(), swaggerParser.GetDefaultValue(x))
                                                                                 :  string.Format("{0}{1} {2}", swaggerParser.GetParameterType(x), swaggerParser.GetDefaultType(x), x.Type.GetCleanName())));
                    var methodShow = string.Empty;
                    switch (operationDef.Method.ToUpperInvariant())
                    {
                    case "GET":
                        methodShow = "Get";
                        break;

                    case "POST":
                        methodShow = "Post";
                        break;

                    case "DELETE":
                        methodShow = "Delete";
                        break;

                    case "PUT":
                        methodShow = "Put";
                        break;

                    default:
                        break;
                    }



            #line default
            #line hidden
                    this.Write("\t/// <summary>\r\n    /// ");

            #line 142 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(operationDef.Description ?? ""));

            #line default
            #line hidden
                    this.Write("\r\n    /// </summary>\r\n\t");

            #line 144 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    foreach (var p in operationDef.Parameters)
                    {
            #line default
            #line hidden
                        this.Write("    /// <param name=\"");

            #line 145 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(p.Type.GetCleanName()));

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

            #line 145 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(p.Description ?? ""));

            #line default
            #line hidden
                        this.Write("</param>\r\n\t");

            #line 146 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    }

            #line default
            #line hidden
                    this.Write("    /// <returns></returns>\r\n\t[");

            #line 148 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(methodShow));

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

            #line 148 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(operationDef.Path));

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

            #line 149 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(returnType));

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

            #line 149 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(operationDef.OperationId));

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

            #line 149 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(parameters));

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

            #line 151 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
                }

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

            #line 153 "E:\MyWorkSpace\SpringCloudDemo\Swagger2WebApiClient\Templates\ApiClientTemplate.tt"
            }

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