Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Created Issue: Provide a way to clear a RazorTemplateBase's _generatingEnvironment [91]

$
0
0
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.

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>