We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccf388f commit d6ca867Copy full SHA for d6ca867
RazorEngineCore.Tests/TestCompileAndRun.cs
@@ -157,6 +157,24 @@ public async Task TestCompileAndRun_DynamicModel_PlainAsync()
157
Assert.AreEqual("Hello Alex", actual);
158
}
159
160
+ public struct Item
161
+ {
162
+ public string Name { get; set; }
163
+ }
164
+
165
+ [TestMethod]
166
+ public void TestCompileAndRun_StructList()
167
168
+ var eng = new RazorEngine();
169
+ var model = new
170
171
+ Items = new[] { new Item { Name = "Bob" }, new Item { Name = "Alice" } }
172
+ };
173
+ var temp = eng.Compile("@foreach(var item in Model.Items) { @item.Name }");
174
+ var result = temp.Run(model);
175
+ Assert.AreEqual("BobAlice", result);
176
177
178
[TestMethod]
179
public void TestCompileAndRun_DynamicModel_Nested()
180
{
0 commit comments