23 lines
739 B
C#
23 lines
739 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Vault.Demo.hashicorp.Console;
|
|
using Vault.Demo.hashicorp.Console.Handler;
|
|
using Vault.Demo.hashicorp.Console.Helper;
|
|
using VaultSharp;
|
|
|
|
var builder = Host.CreateDefaultBuilder(args);
|
|
builder.ConfigureServices(s =>
|
|
{
|
|
s.AddSingleton<IValueClientProvider, ValueClientProvider>();
|
|
s.AddSingleton<IConnectionStringProvider, ConnectionStringProvider>();
|
|
s.AddSingleton<App>();
|
|
});
|
|
|
|
|
|
using var app = builder.Build();
|
|
using var scope = app.Services.CreateScope();
|
|
var application = scope.ServiceProvider.GetRequiredService<App>();
|
|
if (args.Length > 0)
|
|
await application.Run(args[0]);
|
|
else
|
|
Console.WriteLine("No project found to run"); |