- Updated `CommandManager` to include an `IEnvelopeReceiverService` constructor and a new property for service access. Added version printing functionality in the `Execute` method. - Modified `AddCommandManagerRunner` in `DependencyInjection` to accept a connection string key name and added SQL Server caching configuration. - Added `Microsoft.Extensions.Caching.SqlServer` package reference in the project file for caching support.
19 lines
582 B
C#
19 lines
582 B
C#
using CommandDotNet;
|
|
using EnvelopeGenerator.Application.Contracts.Services;
|
|
using System.Reflection;
|
|
|
|
namespace EnvelopeGenerator.Terminal;
|
|
|
|
public class CommandManager(IEnvelopeReceiverService envelopeReceiverService)
|
|
{
|
|
[DefaultCommand]
|
|
public void Execute([Option(Description = "print envelope generator termianal version.")] bool version)
|
|
{
|
|
if(version)
|
|
Console.WriteLine($"v{Assembly.GetExecutingAssembly().GetName().Version}");
|
|
}
|
|
|
|
[Subcommand]
|
|
public IEnvelopeReceiverService EnvelopeReceiverService => envelopeReceiverService;
|
|
}
|