Пример #1
0
 public new async Task <string> RunAsync()
 {
     return(await Task.Run(async() =>
     {
         var document = await GetInputSwaggerDocument().ConfigureAwait(false);
         _preProcessor?.ApplyProcessing(document);
         var clientGenerator = new SwaggerToCSharpControllerGenerator(document, Settings);
         return _sourceCodePrefixer.AddPrefixTemplate(clientGenerator.GenerateFile());
     }));
 }
Пример #2
0
        public new async Task <Dictionary <string, string> > RunAsync()
        {
            return(await Task.Run(async() =>
            {
                var document = await GetInputSwaggerDocument().ConfigureAwait(false);
                _preProcessor?.ApplyProcessing(document);
                var clientGenerator = new SwaggerToCSharpClientGenerator(document, Settings);

                if (GenerateContractsOutput)
                {
                    var result = new Dictionary <string, string>();
                    GenerateContracts(result, clientGenerator);
                    GenerateImplementation(result, clientGenerator);
                    return result;
                }
                else
                {
                    return new Dictionary <string, string>
                    {
                        { OutputFilePath ?? "Full", _sourceCodePrefixer.AddPrefixTemplate(clientGenerator.GenerateFile(ClientGeneratorOutputType.Full)) }
                    };
                }
            }));
        }