From b8abda680020cde94969200ab7f6a60bcc87f611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Wed, 10 Dec 2025 15:25:28 +0300 Subject: [PATCH] Refactor telemetry activity initialization in AddModuleCommand Moved solutionFile assignment to after telemetry activity tracking and removed passing solutionFile as a telemetry property. This streamlines the activity initialization and improves code clarity. --- .../Volo/Abp/Cli/Commands/AddModuleCommand.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs index d32498d970..204882a597 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs @@ -69,14 +69,10 @@ public class AddModuleCommand : IConsoleCommand, ITransientDependency } var newTemplate = commandLineArgs.Options.ContainsKey(Options.NewTemplate.Long); - var solutionFile = GetSolutionFile(commandLineArgs); await using var _ = TelemetryService.TrackActivityAsync(newTemplate ? ActivityNameConsts.AbpCliCommandsInstallLocalModule - : ActivityNameConsts.AbpCliCommandsInstallModule, o => - { - o[ActivityPropertyNames.SolutionPath] = solutionFile; - }); + : ActivityNameConsts.AbpCliCommandsInstallModule); var template = commandLineArgs.Options.GetOrNull(Options.Template.Short, Options.Template.Long); var newProTemplate = !string.IsNullOrEmpty(template) && template == ModuleProTemplate.TemplateName; @@ -84,6 +80,7 @@ public class AddModuleCommand : IConsoleCommand, ITransientDependency var addSourceCodeToSolutionFile = withSourceCode && commandLineArgs.Options.ContainsKey("add-to-solution-file"); var skipOpeningDocumentation = commandLineArgs.Options.ContainsKey(Options.SkipOpeningDocumentation.Long); var skipDbMigrations = newTemplate || newProTemplate || commandLineArgs.Options.ContainsKey(Options.DbMigrations.Skip); + var solutionFile = GetSolutionFile(commandLineArgs); var version = commandLineArgs.Options.GetOrNull(Options.Version.Short, Options.Version.Long); if (version == null)