DKNet.Svc.Transformation
9.0.38
dotnet add package DKNet.Svc.Transformation --version 9.0.38
NuGet\Install-Package DKNet.Svc.Transformation -Version 9.0.38
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="9.0.38" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DKNet.Svc.Transformation" Version="9.0.38" />
<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 9.0.38
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DKNet.Svc.Transformation, 9.0.38"
#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@9.0.38
#: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=9.0.38
#tool nuget:?package=DKNet.Svc.Transformation&version=9.0.38
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 | 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.
-
net9.0
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 |
---|---|---|
9.0.38 | 12 | 9/24/2025 |
9.0.37 | 39 | 9/23/2025 |
9.0.36 | 44 | 9/23/2025 |
9.0.35 | 40 | 9/23/2025 |
9.0.34 | 47 | 9/23/2025 |
9.0.33 | 52 | 9/21/2025 |
9.0.32 | 63 | 9/21/2025 |
9.0.31 | 238 | 9/19/2025 |
9.0.30 | 251 | 9/18/2025 |
9.0.29 | 251 | 9/18/2025 |
9.0.28 | 255 | 9/17/2025 |
9.0.27 | 256 | 9/17/2025 |
9.0.26 | 262 | 9/16/2025 |
9.0.25 | 200 | 9/15/2025 |
9.0.24 | 201 | 9/15/2025 |
9.0.23 | 68 | 9/6/2025 |
9.0.22 | 142 | 9/3/2025 |
9.0.21 | 129 | 9/1/2025 |
9.0.20 | 144 | 7/15/2025 |
9.0.19 | 139 | 7/14/2025 |
9.0.18 | 143 | 7/14/2025 |
9.0.17 | 139 | 7/14/2025 |
9.0.16 | 117 | 7/11/2025 |
9.0.15 | 122 | 7/11/2025 |
9.0.14 | 124 | 7/11/2025 |
9.0.13 | 129 | 7/11/2025 |
9.0.12 | 148 | 7/8/2025 |
9.0.11 | 141 | 7/8/2025 |
9.0.10 | 136 | 7/7/2025 |
9.0.9 | 138 | 7/2/2025 |
9.0.8 | 143 | 7/2/2025 |
9.0.7 | 148 | 7/1/2025 |
9.0.5 | 142 | 6/24/2025 |
9.0.4 | 145 | 6/24/2025 |
9.0.3 | 141 | 6/23/2025 |
9.0.2 | 144 | 6/23/2025 |
9.0.1 | 148 | 6/23/2025 |