From bc941196197c4d284b96773d47a0ecc33ed57912 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 25 Oct 2022 20:49:58 +0800 Subject: [PATCH] Remove duplicate method. --- .../Volo/Abp/Cli/Commands/ProxyCommandBase.cs | 4 ++-- .../CSharp/CSharpServiceProxyGenerator.cs | 20 ++----------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs index f90926dadc..ac243359c0 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs @@ -68,9 +68,9 @@ public abstract class ProxyCommandBase : IConsoleCommand, ITransientDependenc var source = commandLineArgs.Options.GetOrNull(Options.Source.Short, Options.Source.Long); var workDirectory = commandLineArgs.Options.GetOrNull(Options.WorkDirectory.Short, Options.WorkDirectory.Long) ?? Directory.GetCurrentDirectory(); var folder = commandLineArgs.Options.GetOrNull(Options.Folder.Long); - var withContracts = commandLineArgs.Options.ContainsKey(Options.WithoutContracts.Long); + var withoutContracts = commandLineArgs.Options.ContainsKey(Options.WithoutContracts.Long); - return new GenerateProxyArgs(CommandName, workDirectory, module, url, output, target, apiName, source, folder, withContracts, commandLineArgs.Options); + return new GenerateProxyArgs(CommandName, workDirectory, module, url, output, target, apiName, source, folder, withoutContracts, commandLineArgs.Options); } public virtual string GetUsageInfo() diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/CSharp/CSharpServiceProxyGenerator.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/CSharp/CSharpServiceProxyGenerator.cs index 3c8a1d42ce..f2b151bb53 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/CSharp/CSharpServiceProxyGenerator.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/CSharp/CSharpServiceProxyGenerator.cs @@ -130,13 +130,8 @@ public class CSharpServiceProxyGenerator : ServiceProxyGeneratorBase x.Controllers) - .Where(x => x.Value.Interfaces.Any() && ServicePostfixes.Any(s => x.Value.Interfaces.Last().Type.EndsWith(s)))) - { - await GenerateClassFileAsync(args, controller.Value); - } - - foreach (var controller in applicationApiDescriptionModel.Modules.Values.SelectMany(x => x.Controllers).Where(x => ShouldGenerateProxy(x.Value))) + foreach (var controller in applicationApiDescriptionModel.Modules.Values.SelectMany(x => x.Controllers). + Where(x => x.Value.Interfaces.Any() && ServicePostfixes.Any(s => x.Value.Interfaces.Last().Type.EndsWith(s)))) { await GenerateClassFileAsync(args, controller.Value); } @@ -149,17 +144,6 @@ public class CSharpServiceProxyGenerator : ServiceProxyGeneratorBase serviceInterface.Type.EndsWith(x)); - } - private async Task CreateJsonFile(GenerateProxyArgs args, ApplicationApiDescriptionModel applicationApiDescriptionModel) { var folder = args.Folder.IsNullOrWhiteSpace() ? ProxyDirectory : args.Folder;