DKNet.Svc.Transformation
10.0.20
dotnet add package DKNet.Svc.Transformation --version 10.0.20
NuGet\Install-Package DKNet.Svc.Transformation -Version 10.0.20
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="DKNet.Svc.Transformation" Version="10.0.20" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DKNet.Svc.Transformation" Version="10.0.20" />
<PackageReference Include="DKNet.Svc.Transformation" />
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 DKNet.Svc.Transformation --version 10.0.20
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DKNet.Svc.Transformation, 10.0.20"
#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 DKNet.Svc.Transformation@10.0.20
#: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=DKNet.Svc.Transformation&version=10.0.20
#tool nuget:?package=DKNet.Svc.Transformation&version=10.0.20
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DKNet.Svc.Transformation
A flexible .NET library for template-based data transformation, designed for APIs, DDD, and EF Core scenarios. Supports custom token extraction, dynamic value resolution, and is fully configurable via dependency injection.
Features
- Transform template strings using data objects or custom token factories
- Extensible token extractors for different template formats
- Configurable value formatting and caching
- Designed for dependency injection
- .NET 9.0 compatible
Installation
Add the NuGet package to your project:
dotnet add package DKNet.Svc.Transformation
Usage
Register the service in your DI container:
using Microsoft.Extensions.DependencyInjection;
using DKNet.Svc.Transformation;
var services = new ServiceCollection();
services.AddTransformerService(options =>
{
// Customize TransformOptions if needed
options.DisabledLocalCache = false;
});
Transform a template string:
var transformer = services.BuildServiceProvider().GetRequiredService<ITransformerService>();
string template = "Hello [Name]. Your {Email} had been [ApprovedStatus]";
var result = await transformer.TransformAsync(template, new { Name = "Duy", Email = "drunkcoding@outlook.net", ApprovedStatus = "Approved" });
// result: "Hello Duy. Your drunkcoding@outlook.net had been Approved"
Or use a custom token factory:
var result = await transformer.TransformAsync(template, async token =>
{
// Custom logic to resolve token value
return await GetValueForTokenAsync(token);
});
API
ITransformerService.TransformAsync(string templateString, params object[] parameters): Transform using provided data objects.ITransformerService.TransformAsync(string templateString, Func<IToken, Task<object>> tokenFactory): Transform using a custom token resolver.TransformOptions: Configure extractors, formatters, caching, and global parameters.TransformSetup.AddTransformerService(IServiceCollection, Action<TransformOptions>?): Register the service with DI.
License
MIT © 2026 drunkcoding
Repository
https://github.com/baoduy/DKNet
Contributing
Pull requests and issues are welcome!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.20 | 100 | 2/2/2026 |
| 10.0.19 | 90 | 1/21/2026 |
| 10.0.18 | 93 | 1/21/2026 |
| 10.0.17 | 91 | 1/19/2026 |
| 10.0.16 | 91 | 1/18/2026 |
| 10.0.15 | 88 | 1/18/2026 |
| 10.0.14 | 89 | 1/18/2026 |
| 10.0.13 | 85 | 1/17/2026 |
| 10.0.12 | 87 | 1/17/2026 |
| 10.0.11 | 98 | 1/17/2026 |
| 10.0.10 | 89 | 1/17/2026 |
| 10.0.9 | 91 | 1/16/2026 |
| 10.0.8 | 96 | 1/16/2026 |
| 10.0.7 | 182 | 11/28/2025 |
| 10.0.6 | 195 | 11/27/2025 |
| 10.0.5 | 196 | 11/24/2025 |
| 10.0.4 | 195 | 11/24/2025 |
| 10.0.3 | 375 | 11/21/2025 |
| 10.0.2 | 408 | 11/20/2025 |
| 0.0.1 | 397 | 11/19/2025 |
Loading failed