public static async Task <int> Main(string[] args) { CompositeResolver.RegisterAndSetAsDefault(FSharpResolver.Instance, StandardResolver.Default); try { await BatchHost .CreateDefaultBuilder() .UseServiceProviderFactory <IUnityContainer>(new ServiceProviderFactory(new UnityContainer())) .ConfigureContainer <IUnityContainer>((hostContext, container) => { container.RegisterInstance <IMessageBroker>(Reactive.Bindings.Notifiers.MessageBroker.Default); container.RegisterInstance <IUnityContainer>(container); container.RegisterType <ICommandBus, CommandBus>(); container.RegisterType <I発送本DTOQuery, 発送本DTOQuery>(); container.RegisterType <I本を発送するCommand, 本を発送するCommand>(); container.RegisterType <I本を発送するCommandHandler, 本を発送するCommandHandler>(); }) .RunBatchEngineAsync <Scenario>(args); return(Environment.ExitCode); } catch (Exception ex) when((ex is ArgumentException) || (ex is ArgumentNullException)) { Console.WriteLine(ex.Message); return(1); } catch (Exception) { return(9); } }
static async Task Main(string[] args) => await BatchHost.CreateDefaultBuilder() .ConfigureServices((hostContext, services) => { services.AddSingleton <IBuilder, Builder>(); services.AddSingleton <ISettings, Settings>(); }) .RunBatchEngineAsync <UnityBuildRunnerBatch>(args);
static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder() .ConfigureServices((hostContext, services) => { // mapping config json to IOption<MyConfig> services.Configure <MyConfig>(hostContext.Configuration); }) .RunBatchEngineAsync <MyFirstBatch>(args); }
static async Task Main(string[] args) { args = @"-array [10,20,30] -person {""Age"":10,""Name"":""foo""}".Split(' '); await BatchHost.CreateDefaultBuilder() .ConfigureServices((hostContext, services) => { // mapping config json to IOption<MyConfig> services.Configure <MyConfig>(hostContext.Configuration); }) .RunBatchEngineAsync <ComplexArgTest>(args); }
public static async Task Main(string[] args) { await BatchHost .CreateDefaultBuilder() .UseServiceProviderFactory <IUnityContainer>(new ServiceProviderFactory(new UnityContainer())) .ConfigureContainer <IUnityContainer>((hostContext, container) => { container.RegisterType <I本Repository, DeliverySubDomain本Repository>(); container.RegisterType <I本Factory, DeliverySubDomain本Factory>(); }) .RunBatchEngineAsync <Daemon>(args); }
public static async Task <int> Main(string[] args) { try { await BatchHost .CreateDefaultBuilder() // .ConfigureServices((context, services) => { }) .UseServiceProviderFactory <IUnityContainer>(new ServiceProviderFactory(new UnityContainer())) .ConfigureContainer <IUnityContainer>((hostContext, container) => { container.RegisterInstance <IMessageBroker>(Reactive.Bindings.Notifiers.MessageBroker.Default); container.RegisterInstance <IUnityContainer>(container); container.RegisterType <I書籍Factory, 書籍Factory>(); container.RegisterType <I本Factory, RentalSubDomain本Factory>(); container.RegisterType <I利用者Factory, 利用者Factory>(); container.RegisterType <CommandBus, CommandBus>(); container.RegisterFactory <ICommandBus>(c => new CommandBusDecorator(c.Resolve <CommandBus>())); container.RegisterType <I利用者を登録するCommandHandler, 利用者を登録するCommandHandler>(); container.RegisterType <I利用者を登録するCommand, 利用者を登録するCommand>(); container.RegisterType <I本を登録するCommandHandler, 本を登録するCommandHandler>(); container.RegisterType <I本を登録するCommand, 本を登録するCommand>(); container.RegisterType <I本が登録されたEvent, 本が登録されたEvent>(); container.RegisterType <I本を登録する2CommandHandler, 本を登録する2CommandHandler>(); container.RegisterType <I本を登録する2Command, 本を登録する2Command>(); container.RegisterType <I本を借りるCommandHandler, 本を借りるCommandHandler>(); container.RegisterType <I本を借りるCommand, 本を借りるCommand>(); container.RegisterType <I本を延長するCommandHandler, 本を延長するCommandHandler>(); container.RegisterType <I本を延長するCommand, 本を延長するCommand>(); container.RegisterType <I本を返すCommandHandler, 本を返すCommandHandler>(); container.RegisterType <I本を返すCommand, 本を返すCommand>(); container.RegisterType <I本を破棄するCommandHandler, 本を破棄するCommandHandler>(); container.RegisterType <I本を破棄するCommand, 本を破棄するCommand>(); container.RegisterType <Iログイン情報Query, ログイン情報Query>(); container.RegisterType <I本の状況Query, 本の状況Query>(); }) .RunBatchEngineAsync <Scenario>(args); return(Environment.ExitCode); } catch (Exception ex) when((ex is ArgumentException) || (ex is ArgumentNullException)) { Console.WriteLine(ex.Message); return(1); } catch (Exception) { return(9); } }
static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder() .ConfigureServices((context, services) => { services.AddHttpClient("agones", client => { client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); }); services.AddSingleton <IAgonesSdk, AgonesSdk>(); services.AddHostedService <AgonesHostedService>(); }) .RunBatchEngineAsync <EchoUdpServerBatch>(args); }
public async Task TestCommandName() { var host = BatchHost.CreateDefaultBuilder() .ConfigureServices((c, services) => { services.AddSingleton <ResultContainer>(); }) .UseBatchEngine <CommandAttributeTestCommand>(new string[] { "test", "-value", "1" }) .Build(); var result = host.Services.GetService <ResultContainer>(); await host.RunAsync(); result.X.Should().Be(1); }
public static async Task Main(string[] args) { CompositeResolver.RegisterAndSetAsDefault(FSharpResolver.Instance, StandardResolver.Default); await BatchHost .CreateDefaultBuilder() .UseServiceProviderFactory <IUnityContainer>(new ServiceProviderFactory(new UnityContainer())) .ConfigureContainer <IUnityContainer>((hostContext, container) => { container.RegisterType <I本Repository, RentalSubDomain本Repository>(); container.RegisterType <I書籍Repository, 書籍Repository>(); container.RegisterType <I利用者Repository, 利用者Repository>(); container.RegisterType <I利用者Factory, 利用者Factory>(); container.RegisterType <I本Factory, RentalSubDomain本Factory>(); container.RegisterType <I書籍Factory, 書籍Factory>(); }) .RunBatchEngineAsync <Daemon>(args); }
private static async Task Main(string[] args) => await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <CreateEntityBatch>(args);
static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <Program>(args); }
// C# 7.1(update lang version) static async Task Main(string[] args) { // you can use new HostBuilder() instead of CreateDefaultBuilder await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <MyFirstBatch>(args); }
public static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <GrpcClient>(args); }
static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <QueryToCSharp>(args); }
static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder() .ConfigureServices((context, services) => services.AddHttpClient()) .RunBatchEngineAsync <DnsResolution>(args); }
static void Main(string[] args) { BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <ExplorerBatch>(args); }
static void Main(string[] args) => BatchHost.CreateDefaultBuilder() .RunBatchEngineAsync <GeneratorBatch>(args);
private static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <MessagepackCompiler>(args).ConfigureAwait(false); }
static async Task Main(string[] args) => await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <PathMapBatch>(args);
static async Task Main(string[] args) => await BatchHost.CreateDefaultBuilder() .RunBatchEngineAsync <QueryDivider>(args);
/// <summary> /// Entry Point /// </summary> /// <param name="args">Command Line Args</param> static async Task Main(string[] args) { await BatchHost.CreateDefaultBuilder().RunBatchEngineAsync <TilHpGenerateBatch>(args); }