I want to be able to use a template in a loop, like so:
@{ var fooView = new FooView(); } <!-- FooView is a compiled template that outputs a li -->
<ul>
@foreach (var foo in foos) {
@{
fooView.Clear();
fooView.Foo = foo;
}
@fooView.TransformText()
}
</ul>
The lack of a `Clear()` method means that each time I call `TransformText()` the internal `StringBuilder` (`_generatingEnvironment`) just keeps appending new `<li>`s.
@{ var fooView = new FooView(); } <!-- FooView is a compiled template that outputs a li -->
<ul>
@foreach (var foo in foos) {
@{
fooView.Clear();
fooView.Foo = foo;
}
@fooView.TransformText()
}
</ul>
The lack of a `Clear()` method means that each time I call `TransformText()` the internal `StringBuilder` (`_generatingEnvironment`) just keeps appending new `<li>`s.