Abstractions

Dosaic.Hosting.Abstractions is the core abstraction/interface package that allows dotnet dev's to develop their own plugins.

Installation

To install the nuget package follow these steps:

dotnet add package Dosaic.Hosting.Abstractions

or add as package reference to your .csproj

<PackageReference Include="Dosaic.Hosting.Abstractions" Version="" />

ConfigurationAttribute

The configuration attribute can be used to easily create an configuration class for your plugin. The class decorated with the attribute is automatically bound on startup to the their corresponding setting values from appsettings files or ENV variables.

example:
  mykey: "myvalue"
using Dosaic.Hosting.Abstractions.Attributes;
[Configuration("example")]
public class ExampleConfiguration
{
    public string MyKey { get; set; };

}

the class then can be consumed in any plugin via their constructor

Plugin application configuration

This allows you in instruct the web host to execute certain methods on the application builder while the web host is starting. This is mainly used for UseXYZ extensions methods which usually are required by other 3rd party nuget packages.

Plugin service configuration

This allows you in instruct the web host to execute certain methods on the service collection while the web host is starting This is mainly used for IoC/DI registrations or other service setup methods.

Plugin health checks configuration & health check attribute

this enables the registration of health checks for which are exposed by the web host. The usage follows the documentation of the asp.net core health checks.

the same can be achieved by decorating an health implemented class with the attributes

Plugin endpoints configuration

This enables the usage of dotnet 6 minimal apis. The official documentation of asp core minimal apis is valid and applicable

Plugin controller configuration

This enables the configuration of the controllers of your plugin

Metrics

Dosaic uses open telemetry for it's metrics capabilities with some wrappers for better developer experience Generally speaking anything from the open telemetry documentationarrow-up-right should be applicable and valid.

Simple metrics can be created and used like this

or with tags

as pre defined field

Default exposed metrics

DosaicException

//TODO

Date abstraction

Dosaic used chronos.netarrow-up-right as an datetime abstraction layer to enable test ability of implementations.

Last updated