1. Create a class that implements ITag<T> for the wanted type (a class Person with a Name property for example):
public class NameTag : ITag<Person>
{
public string Description => "Returns the name of a Person.";
public string Name => "Name";
public string Resolve(Person value) => value.Name.ToString();
}
2. Create a Parser<T> with this tag:
var parser = new Parser<Person>().WithTag(new NameTag());
3. Resolve a string with the parser:
var result = parser.Resolve("My name is {Name}.", new Person { Name = "James" }); // will return "My name is James."
For more complex examples with multiple tags, filters and parameter tags, see the usage section. The code of this example is here.