Skip to content

Commit 7067d87

Browse files
committed
fix(cli): Fixed some warnings in generated code for CLI
1 parent e385d16 commit 7067d87

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/libs/AutoSDK/Sources/Sources.CLI.AddCommands.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,30 @@ public static string GenerateAddCommands(
2020
2121
namespace {methods[0].Settings.Namespace}
2222
{{
23-
public static class ServiceCollectionExtensions
23+
/// <summary>
24+
/// Provides extension methods for adding command services to the dependency injection container.
25+
/// </summary>
26+
internal static class ServiceCollectionExtensions
2427
{{
28+
/// <summary>
29+
/// Registers all command services required by the application into the dependency injection container.
30+
/// </summary>
31+
/// <param name=""services"">The <see cref=""global::Microsoft.Extensions.DependencyInjection.IServiceCollection""/> to which the services will be added.</param>
32+
/// <returns>The updated <see cref=""global::Microsoft.Extensions.DependencyInjection.IServiceCollection""/> instance.</returns>
2533
public static global::Microsoft.Extensions.DependencyInjection.IServiceCollection AddCommands(
2634
this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services)
2735
{{
36+
// Register individual command services as singletons
2837
{methods.Select(x => $"{x.MethodName}Command").Distinct().Select((type, i) => @$"
2938
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<
3039
{type}>(services);").Inject()}
3140
41+
// Register grouped command services as singletons
3242
{tags.Select(x => $"{x.SingularizedName}Command").Distinct().Select((type, i) => @$"
3343
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<
3444
{type}>(services);").Inject()}
3545
46+
// Register the main command service as a singleton
3647
global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<
3748
MainCommand>(services);
3849

0 commit comments

Comments
 (0)