static async Task Main(string[] args) { await CoconaApp.Create() .ConfigureServices(services => { services.AddSingleton <ICoconaValueConverter, JsonValueConverter>(); }) .RunAsync <Program>(args); }
private static async Task Main(string[] args) { await CoconaApp.Create().ConfigureServices( services => { services.AddTransient <IFileConfigurationService <RocksDbServiceConfiguration>, RocksDbServiceFileConfigurationService>(); services.AddTransient <IRocksDbService, RocksDbService>(); services.AddTransient <IInputOutputErrorContainer, StandardInputOutputErrorContainer>(); }).RunAsync <RocksDbCommand>(args); }
static void Main(string[] args) { System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); CoconaApp.Create() .ConfigureServices(services => { services.AddTransient <PMDCompileTestService>(); }) .Run <Program>(args); }
static void Main(string[] args) { CoconaApp.Create() .ConfigureServices((hostContext, services) => { services.Configure <ConnectionStringOptions>(hostContext.Configuration); services.AddTransient <IChangeSetRepository, ChangeSetAzureStorageRepository>(); services.AddTransient <IStatusRawDataRepository, StatusRawDataAzureStorageRepository>(); services.AddTransient <DataUpdateAgent>(); }) .Run <Program>(args); }
static void Main(string[] args) { CoconaApp.Create() .ConfigureLogging(logging => { logging.AddDebug(); }) .ConfigureServices(services => { services.AddTransient <MyService>(); }) .Run <Program>(args); }
public static int Main(string[] args) { var app = CoconaApp.Create(args, options => { options.TreatPublicMethodsAsCommands = true; options.EnableShellCompletionSupport = true; }); app.AddCommands <CommandLineCommands>(); app.Run(); var services = new ServiceCollection(); ConfigureServices(services); var serviceProvider = services .AddSingleton <CyCompiler, CyCompiler>() .BuildServiceProvider(); var result = serviceProvider.GetService <CyCompiler>().Compile(); return(result); }