Skip to content

Configure SharpBatch in a Project

ivano scifoni edited this page Jan 25, 2018 · 4 revisions

SharpBatch is a library developed on Netstandard2.0, you can configure the SharpBatch middleware using extention AddSharpBatch and UseSharpBatch in a startup class

public void ConfigureServices(IServiceCollection services)
{
        // Add framework services.
        services.AddSharpBatch();
        services.AddMvc();
}

public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
        loggerFactory.AddConsole(Configuration.GetSection("Logging"));
        loggerFactory.AddDebug();

        app.UseSharpBatch();
}

the middleware creates a routing system for all the Batch of the application and linked library. The template url is :

http[s]://ServerName:ServerPort/Batch/[Command][/BatchName/BatchActionName]

the [command] is the command who SharpBatch will execute, it could contain

  • Exec
  • Status

Command details are explained on this page

Clone this wiki locally