-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathHomeController.cs
More file actions
36 lines (32 loc) · 1.07 KB
/
HomeController.cs
File metadata and controls
36 lines (32 loc) · 1.07 KB
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
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using StackExchange.Precompilation;
namespace Test.WebApp.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
IEnumerable<string> viewPaths;
#if DEBUG
viewPaths = new string[] { "We don't keep track of the views in the RoslynRazorViewEngine." };
#else
var viewEngine = ViewEngines.Engines.OfType<PrecompiledViewEngine>().Single();
viewPaths = viewEngine.ViewPaths;
#endif
return View(new Models.SampleModel { ViewPaths = viewPaths });
}
public ActionResult IndexOverridden()
{
return new ViewResult
{
ViewName = "~/Views/Home/Index.cshtml",
MasterName = "~/Views/Shared/_Layout.Overridden.cshtml",
ViewData = new ViewDataDictionary(new Models.SampleModel { ViewPaths = new [] { "OVERRIDDDDDEN" } }),
};
}
public ActionResult ExcludedLayout() => View();
}
}