forked from NancyFx/Nancy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainModule.cs
More file actions
26 lines (23 loc) · 828 Bytes
/
Copy pathMainModule.cs
File metadata and controls
26 lines (23 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace Nancy.Demo.SuperSimpleViewEngine
{
using Nancy.Demo.SuperSimpleViewEngine.Models;
public class MainModule : NancyModule
{
/// <summary>
/// Initializes a new instance of the <see cref="INancyModule"/> class.
/// </summary>
public MainModule()
{
Get["/"] =
(x) =>
{
ViewBag.Test = "Test ViewBag";
var model = new MainModel(
"Jimbo",
new[] {new User("Bob", "Smith"), new User("Jimbo", "Jones"), new User("Bill", "Bobs"),},
"<script type=\"text/javascript\">alert('Naughty JavaScript!');</script>");
return View["Index", model];
};
}
}
}