BatchSharp 0.2.2

dotnet add package BatchSharp --version 0.2.2
                    
NuGet\Install-Package BatchSharp -Version 0.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BatchSharp" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BatchSharp" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="BatchSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BatchSharp --version 0.2.2
                    
#r "nuget: BatchSharp, 0.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BatchSharp@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BatchSharp&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=BatchSharp&version=0.2.2
                    
Install as a Cake Tool

BatchSharp

Nuget Nuget CI Codacy Badge Codacy Badge

BatchSharp is a simple framework for batch application. This is inspired from Spring Batch.

Getting Started

BatchSharp can be installed using the Nuget package manager or the dotnet CLI.

  • Package Manager

    Install-Package BatchSharp
    
  • dotnet CLI

    dotnet add package BatchSharp
    

Using BatchSharp

  1. Create the main class

    using BatchSharp;
    using BatchSharp.Example;
    using BatchSharp.Example.Processor;
    using BatchSharp.Example.Reader;
    using BatchSharp.Example.Writer;
    using BatchSharp.Processor;
    using BatchSharp.Reader;
    using BatchSharp.Writer;
    
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Hosting;
    
    var builder = Host.CreateDefaultBuilder(args)
        .ConfigureHostConfiguration(builder =>
        {
            builder.AddBatchConfiguration();
        })
        .ConfigureServices((_, services) =>
        {
            services.AddHostedService<BatchHostedService>()
                .AddScoped<IBatchApplication, ExampleBatchApplication>()
                .AddScoped<IReader<string>, ExampleReader>();
            services.AddScoped<IProcessor<string, int>, ExampleProcessor>();
            services.AddScoped<IWriter<int>, ExampleWriter>();
            services.AddScoped<IStep, SimpleStep<string, int>>();
            services.AddScoped<IStepState, StepState>();
        });
    
    var app = builder.Build();
    await app.RunAsync();
    
  2. Add the batch application endpoint

    Configure batch application input and output type.

    Add the class of application endpoint that extend DefaultBatchApplication class. First type parameter is input type, second type parameter is output type.

    IReader is used to read input data. IProcessor is used to process input data. IWriter is used to write output data. These class are injected by DI container.

    public class ExampleBatchApplication : DefaultBatchApplication<string, int>
    {
        public ExampleBatchApplication(
            ILogger<ExampleBatchApplication> logger,
            IStep step)
            : base(logger, step)
        {
        }
    }
    
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2 167 7/17/2024
0.2.1 262 7/31/2023
0.2.0 256 7/26/2023
0.1.1 260 7/1/2023
0.1.1-alpha5 221 6/24/2023
0.1.1-alpha2 230 6/24/2023
0.1.1-alpha-1 214 6/24/2023
0.1.0 309 6/14/2023