Abstractions of `Tectonic.Core`, a standardized approach for resolving and executing activity based workflows.
$ dotnet add package Tectonic.AbstractionsAbstractions of Tectonic.Core, a standardized approach for resolving and executing activity based workflows.
Add a reference to the abstractions from your library project:
<PackageReference Include="Tectonic.Abstractions" Version="0.8.0" />
Create a class that implements IActivity<TInput, TOutput>.
The constructor should assign any services you require via dependency injection.
The TInput and TOutput can be any class, the execution environment will handle assigning inputs and displaying outputs.
public class CreateSomethingAsAnActivity : IActivity<MyInputClass, MyOutputClass>
{
private readonly ILogger<CreateSomethingAsAnActivity> _logger;
public CreateSomethingAsAnActivity(ILogger<CreateSomethingAsAnActivity> logger)
{
_logger = logger;
}
public Task<MyOutputClass> Execute(MyInputClass inputs)
{
// Do something with the inputs
MyOutputClass outputs = new();
// Do something with the outputs
return Task.FromResult(outputs);
}
}
Refer to Tectonic.Extensions.CommandLine for how to execute activities and workflows on the command line.