We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The unit test below fails because the result is just a ToString() of the SimpleModel.
How do we get the RazorMachine to use the SimpleModel template?
namespace RazorMachine.Test { public class SimpleModel { public string Name { get; set; } } public class ComplexModel { public SimpleModel SubProperty { get; set; } } [TestClass] public class RazorMachineTest { [TestMethod] public void ComplexModel() { const string expected = "name"; var model = new ComplexModel() { SubProperty = new SimpleModel() { Name = expected } }; var engine = new RazorMachine(includeGeneratedSourceCode: true); engine.RegisterTemplate("~/SimpleModel.cshtml", @"@model RazorMachine.Test.SimpleModel @Model.Name"); ITemplate test = engine.Execute("@Model.SubProperty", model); Assert.AreEqual(expected, test.ToString()); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The unit test below fails because the result is just a ToString() of the SimpleModel.
How do we get the RazorMachine to use the SimpleModel template?
The text was updated successfully, but these errors were encountered: