Agency8.MyTokens 0.0.3

dotnet add package Agency8.MyTokens --version 0.0.3
                    
NuGet\Install-Package Agency8.MyTokens -Version 0.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="Agency8.MyTokens" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Agency8.MyTokens" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Agency8.MyTokens" />
                    
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 Agency8.MyTokens --version 0.0.3
                    
#r "nuget: Agency8.MyTokens, 0.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 Agency8.MyTokens@0.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=Agency8.MyTokens&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Agency8.MyTokens&version=0.0.3
                    
Install as a Cake Tool

Agency8.MyTokens

A .NET 9 library for managing and replacing tokens (key-value pairs) in your applications with database persistence, caching support, and optional Blazor UI components.

Overview

Agency8.MyTokens provides a flexible token management system that allows you to store, retrieve, and replace tokens throughout your application. It's particularly useful for managing dynamic configuration values, template placeholders, or any key-value data that needs to be centrally managed and easily replaceable.

Features

  • Token Management: Create, read, update, and delete token key-value pairs
  • Database Persistence: Store tokens in SQL Server or SQLite using Entity Framework Core
  • Caching Support: Built-in caching with options for in-memory or distributed caching
  • Blazor UI Components: Optional pre-built Blazor components for token management (Agency8.MyTokens.BlazorComponents)
  • Token Replacement Helpers: Utility methods for replacing tokens in strings and templates
  • Repository Pattern: Clean architecture with ITokenRepository interface
  • Configurable Behavior: Customize not-found placeholders and cache types
  • License Management: Built-in licensing support for commercial use

Installation

For Blazor UI components:

Quick Start

1. Configure Services

In your Program.cs or Startup.cs:

2. Using the Token Repository

Inject ITokenRepository into your services or controllers:

3. Token Replacement

Use the built-in helpers to replace tokens in your content:

4. Blazor Components (Optional)

Add the MyTokensManager component to your Blazor page:

Configuration Options

MyTokensAddOptions

  • ConnectionString: Database connection string (required)
  • DatabaseType: DatabaseType.SqlServer or DatabaseType.Sqlite

MyTokensUsingOptions

  • NotFoundPlaceholder: Template for missing tokens (default: "[⚠️Token Not Found : {key}⚠️]")
  • MyTokensCacheType: CacheType.InMemory or CacheType.Distributed

Token Entity

Repository Methods

  • GetAllAsync(): Retrieve all tokens
  • GetByIdAsync(Guid id): Get a specific token by ID
  • CreateAsync(Token token): Create a new token
  • UpdateAsync(Token token): Update an existing token
  • DeleteAsync(Guid id): Delete a token
  • RefreshTokenCacheAsync(): Manually refresh the token cache

Caching

MyTokens includes built-in caching to optimize performance:

  • In-Memory Cache: Fast, process-local caching (default)
  • Distributed Cache: For multi-instance deployments (Redis, SQL Server, etc.)

The cache automatically updates when tokens are created, updated, or deleted through the repository.

Database Support

  • SQL Server: Full support with automatic table creation
  • SQLite: Full support for lightweight deployments

The database table is automatically created on first use.

License

This product includes licensing functionality. For commercial use, please contact Agency8 for licensing information.

Product Name: TokenReplacR

Requirements

  • .NET 9.0 or later
  • Entity Framework Core 9.0
  • Supported databases: SQL Server or SQLite

Contributing

Contributions are welcome! Please follow the coding standards defined in the project.

Support

For issues, feature requests, or questions, please visit the project repository or contact Agency8.


Agency8.MyTokens - Simplify your token management and replacement needs.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Agency8.MyTokens:

Package Downloads
Agency8.MyTokens.BlazorComponents

A powerful Blazor component library for building modern web applications. Free for local development - commercial license required for production use.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.3 515 12/9/2025
0.0.2 474 12/8/2025
0.0.1 464 12/8/2025