NMyVision.TemplateWriter 1.1.1

Simple text templating utility. Allows variable placeholders with built in formatting.

Example: "Hello_{Name}_{Date:yyyyMM}" -> "Hello_Peter_201904"

Install-Package NMyVision.TemplateWriter -Version 1.1.1
dotnet add package NMyVision.TemplateWriter --version 1.1.1
<PackageReference Include="NMyVision.TemplateWriter" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NMyVision.TemplateWriter --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

TemplateWriter

Take a string with placeholders and replace with values or by an object.

NuGet

Install-Package  NMyVision.TemplateWriter

Example

var tw = CreateTemplateWriter();
tw.Add("GroupKey", 1221);
tw.Add("CompanyKey", 101);

var tmp = "{GroupKey}_{CompanyKey}_{missing}";

tw.Transform(tmp); // outputs: 1221_101_{missing}
var o = new
{
  GroupKey = 1221,
  CompanyKey = 100
};

var x = TemplateWriter.Transform(tmp, o);

console.log(x); // outputs: 1221_101_{missing}

TemplateWriter

Take a string with placeholders and replace with values or by an object.

NuGet

Install-Package  NMyVision.TemplateWriter

Example

var tw = CreateTemplateWriter();
tw.Add("GroupKey", 1221);
tw.Add("CompanyKey", 101);

var tmp = "{GroupKey}_{CompanyKey}_{missing}";

tw.Transform(tmp); // outputs: 1221_101_{missing}
var o = new
{
  GroupKey = 1221,
  CompanyKey = 100
};

var x = TemplateWriter.Transform(tmp, o);

console.log(x); // outputs: 1221_101_{missing}

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.1 250 5/17/2019
1.1.0 97 5/17/2019
1.0.0-CI00000 131 4/25/2019