Agency8.MyTokens
0.0.3
dotnet add package Agency8.MyTokens --version 0.0.3
NuGet\Install-Package Agency8.MyTokens -Version 0.0.3
<PackageReference Include="Agency8.MyTokens" Version="0.0.3" />
<PackageVersion Include="Agency8.MyTokens" Version="0.0.3" />
<PackageReference Include="Agency8.MyTokens" />
paket add Agency8.MyTokens --version 0.0.3
#r "nuget: Agency8.MyTokens, 0.0.3"
#:package Agency8.MyTokens@0.0.3
#addin nuget:?package=Agency8.MyTokens&version=0.0.3
#tool nuget:?package=Agency8.MyTokens&version=0.0.3
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
ITokenRepositoryinterface - 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.SqlServerorDatabaseType.Sqlite
MyTokensUsingOptions
NotFoundPlaceholder: Template for missing tokens (default:"[⚠️Token Not Found : {key}⚠️]")MyTokensCacheType:CacheType.InMemoryorCacheType.Distributed
Token Entity
Repository Methods
GetAllAsync(): Retrieve all tokensGetByIdAsync(Guid id): Get a specific token by IDCreateAsync(Token token): Create a new tokenUpdateAsync(Token token): Update an existing tokenDeleteAsync(Guid id): Delete a tokenRefreshTokenCacheAsync(): 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 | Versions 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. |
-
net9.0
- Microsoft.AspNetCore.Components (>= 9.0.11)
- Microsoft.AspNetCore.Html.Abstractions (>= 2.3.0)
- Microsoft.EntityFrameworkCore (>= 9.0.11)
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.11)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.11)
- Microsoft.Extensions.Caching.Memory (>= 9.0.11)
- Microsoft.Extensions.Caching.SqlServer (>= 9.0.11)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 10.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.11)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.11)
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.