public CsRazorViewEngine(IViewPageActivator viewPageActivator) : base(viewPageActivator) { AreaViewLocationFormats = AreaViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray(); AreaMasterLocationFormats = AreaMasterLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray(); AreaPartialViewLocationFormats = AreaPartialViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray(); ViewLocationFormats = ViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray(); MasterLocationFormats = MasterLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray(); PartialViewLocationFormats = PartialViewLocationFormats.Where(f => f.EndsWith("cshtml")).ToArray(); FileExtensions = FileExtensions.Where(f => f.EndsWith("cshtml")).ToArray(); }
/// <summary> /// Initializes a new instance of the <see cref="Employment.Web.Mvc.Infrastructure.ViewEngines.CsRazorViewEngine" /> class. /// </summary> public CsRazorViewEngine() { const string extension = "cshtml"; // Only include the cshtml type in location formats and file extensions AreaViewLocationFormats = AreaViewLocationFormats.Where(s => s.EndsWith(extension, StringComparison.Ordinal)).ToArray(); AreaMasterLocationFormats = AreaMasterLocationFormats.Where(s => s.EndsWith(extension, StringComparison.Ordinal)).ToArray(); AreaPartialViewLocationFormats = AreaPartialViewLocationFormats.Where(s => s.EndsWith(extension, StringComparison.Ordinal)).ToArray(); ViewLocationFormats = ViewLocationFormats.Where(s => s.EndsWith(extension, StringComparison.Ordinal)).ToArray(); MasterLocationFormats = MasterLocationFormats.Where(s => s.EndsWith(extension, StringComparison.Ordinal)).ToArray(); PartialViewLocationFormats = PartialViewLocationFormats.Where(s => s.EndsWith(extension, StringComparison.Ordinal)).ToArray(); FileExtensions = FileExtensions.Where(s => s.EndsWith(extension, StringComparison.Ordinal)).ToArray(); }