DropBear.Preflight.Core
1.0.0-build
dotnet add package DropBear.Preflight.Core --version 1.0.0-build
NuGet\Install-Package DropBear.Preflight.Core -Version 1.0.0-build
<PackageReference Include="DropBear.Preflight.Core" Version="1.0.0-build" />
paket add DropBear.Preflight.Core --version 1.0.0-build
#r "nuget: DropBear.Preflight.Core, 1.0.0-build"
// Install DropBear.Preflight.Core as a Cake Addin
#addin nuget:?package=DropBear.Preflight.Core&version=1.0.0-build&prerelease
// Install DropBear.Preflight.Core as a Cake Tool
#tool nuget:?package=DropBear.Preflight.Core&version=1.0.0-build&prerelease
Preflight Core
Preflight.Core is a .NET library that provides an easy-to-use preflight manager.
Features
- Simple API for adding tasks to the preflight manager.
Installation
You can add Preflight.Core to your project by using the NuGet package manager in Visual Studio, or by using the dotnet add package
command in the .NET CLI:
dotnet add package DropBear.Preflight.Core
Usage
First, register the Preflight.Core services in your Startup.cs
file:
public void ConfigureServices(IServiceCollection services)
{
// Other service configuration...
services.AddPreflightCore();
}
Then, you can inject and use IPreflightManager
in your classes:
public class MyClass
{
private readonly IPreflightManager _preflightManager;
public MyClass(IPreflightManager preflightManager)
{
_preflightManager = preflightManager;
}
public async Task MyMethod()
{
var manager = new PreflightManager(config, logger);
manager.AddTask(new ExampleTask(logger));
}
public class ExampleTask : PreflightTask
{
private ILogger<ExampleTask> logger;
public ExampleTask(ILogger<ExampleTask> logger)
{
this.logger = logger;
}
public override async Task ExecuteAsync(CancellationToken cancellationToken)
{
try
{
// Log the start of the task
logger.LogInformation("Starting ExampleTask");
// Do some work...
// Log the completion of the task
logger.LogInformation("Completed ExampleTask");
// Markthe task as completed
MarkAsCompleted();
}
catch (Exception ex)
{
// Log the error
logger.LogError(ex, "Error executing ExampleTask");
throw;
}
}
}
}
Documentation
For more detailed documentation, please see the official documentation.
Contributing
We welcome contributions! Please see our contributing guide for details.
License
Preflight.Core is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net7.0
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Logging (>= 7.0.0)
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 |
---|
Released under MIT license.