Mi sto solo occupando di Nancy, utilizzando la build corrente su Nuget, v0.12.1.0 e mi piacerebbe utilizzare il motore di visualizzazione Razor.Nancy.ViewEngines.Razor v0.12.1.0 supporta le viste Layout amd _ViewStart?
Il v0.12.1.0 del motore di visualizzazione Razor supporta il layout e _ViewStart?
ad es.
Ho il seguente in ~/Views/_ViewStart.cshtml
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
e di seguito nel ~/Views/Shared/_Layout.cshtml
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
<!DOCTYPE html>
<html>
<head>
@RenderSection("head", false)
</head>
<body>
@RenderBody()
</body>
</html>
Ma tutto quello che sto ottenendo quando ho colpito la home page è il contenuto di una vista ho impostato in ~/Views/Home/Index.cshtml
<h1>Home</h1>
Il mio modulo di casa sembra lik e questo:
public class Home : NancyModule
{
public Home()
: base("")
{
Get["/"] = _ => View["Index"];
}
}
_ViewStart è ora supportato – TheCodeJunkie
Hallelujah: D: D – nathanchere