Thoth.Core
3.0.3
There is a newer version of this package available.
See the version list below for details.
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" />
<PackageReference Include="Thoth.Core" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=Thoth.Core&version=3.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
<img src="./docs/icon.png" width="48" /> Thoth
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 | |
Thoth.SQLServer | |
Thoth.Dashboard |
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 | Versions 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.
-
net6.0
- Microsoft.AspNetCore.Hosting (>= 2.2.7)
- Microsoft.AspNetCore.Mvc (>= 2.2.0)
- Microsoft.AspNetCore.SpaServices (>= 3.1.32)
- Microsoft.AspNetCore.SpaServices.Extensions (>= 6.0.16)
- Microsoft.Extensions.Caching.Memory (>= 6.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.3)
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.