如何在RazorEngine模板中使用其他库?

时间:2016-08-10 15:14:51

标签: winforms razorengine

我有一个模板:

android:scaletype="centreCrop"

其中@using Team.Support.DateCalc <h1>@Model.Username</h1> <p>@Model.Address<br> @Model.City, @Model.State @Model.Zip</p> @Model.LastContacted.AddBusinessDays(3) 是应用程序中引用的.AddBusinessDays() lib中的扩展方法。

这是我的应用配置:

Team.Support.DateCalc

这是winform项目中的代码,我在其中创建合并数据:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="razorEngine" type="RazorEngine.Configuration.RazorEngineConfigurationSection, RazorEngine" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
  </startup>

  <razorEngine>
    <namespaces>
      <add namespace="Team.Support.DateCalc" />
    </namespaces>
  </razorEngine>
</configuration>

0 个答案:

没有答案
相关问题