Thoth.Core 3.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Thoth.Core --version 3.0.3
                    
NuGet\Install-Package Thoth.Core -Version 3.0.3
                    
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="Thoth.Core" Version="3.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Thoth.Core" Version="3.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Thoth.Core" />
                    
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 Thoth.Core --version 3.0.3
                    
#r "nuget: Thoth.Core, 3.0.3"
                    
#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 Thoth.Core@3.0.3
                    
#: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=Thoth.Core&version=3.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Thoth.Core&version=3.0.3
                    
Install as a Cake Tool

<img src="./docs/icon.png" width="48" /> Thoth

Quality Gate Status Coverage

A .NET library to easily manage feature flags during runtime, without the need to deploy any new code.

Features

  • Runtime feature management, using database to store flags;
  • In-memory feature flag caching
  • Simple Dashboard to control features state

Install

Package name Nuget
Thoth.Core Nuget
Thoth.SQLServer Nuget
Thoth.Dashboard Nuget

Usage

Add the Thoth Feature Manager to yout application DI (Dependency Injection) container:

builder.Services.AddThoth(options =>
{
    options.ConnectionString = builder.Configuration.GetConnectionString("SqlContext"); // Your application sql database connection
    options.ShouldReturnFalseWhenNotExists = true; // Defines if the default value to a non-existent should be false or throw
    options.EnableCaching = true; // Whether Thoth should use caching strategies to improve performance. Optional.
    options.CacheExpiration = TimeSpan.FromDays(7); // Defines for how long feature flags are going to be cached in memory. Optional.
    options.CacheSlidingExpiration = TimeSpan.FromDays(1); // Defines for how long the feature flags will be cached without being accessed. Optional.
    options.EnableThothApi = True; // Defines if the Thoth Api should be exposed. This is required true when using Dashboard.
}).UseSqlServer(); // Sets Thoth to use SQLServer as its database storage.

A Dashboard can optionally be injected to the application:

var app = builder.Build();
app.UseThothDashboard(options =>
{
    options.RoutePrefix = "/thoth"; // Defines the route prefix to access the dashboard. Optional.
});

Runtime feature management as simples as:

public class MyService
{
    private readonly IThothFeatureManager _thothFeatureManager;

    public MyService(IThothFeatureManager thothFeatureManager)
    {
        _thothFeatureManager = thothFeatureManager;
    }

    public async Task<bool> MyServiceMethod()
    {
        var isFeatureEnabled = await _thothFeatureManager.IsEnabledAsync("MyFeatureFlagName");
        
        if(isFeatureEnabled)
        {
            // do something
        }
        
    }
}

A Sample project is available to DEMO the library.

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 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on Thoth.Core:

Package Downloads
Thoth.Dashboard

Thoth feature flag mangament dashboard.

Thoth.SQLServer

Thoth SQLServer database storage.

Thoth.MongoDb

Thoth MongoDb storage provider.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 13,582 5/22/2023
3.3.0 303 5/19/2023
3.1.5 278 5/18/2023
3.1.1 443 5/18/2023
3.1.0 4,155 4/25/2023
3.0.3 1,112 4/14/2023