public RazorPage(RazorFormat razorFormat, string fullPath, string name, string contents, RazorPageType pageType) : this() { RazorFormat = razorFormat; FilePath = fullPath; Name = name; Contents = contents; PageType = pageType; }
public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName) { var contentPage = RazorPage; if (contentPage == null) { var pageFilePath = this.FilePath.WithoutExtension(); contentPage = RazorFormat.GetContentPage(pageFilePath); } if (contentPage == null) { httpRes.StatusCode = (int)HttpStatusCode.NotFound; return; } RazorFormat.ReloadModifiedPageAndTemplates(contentPage); if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes)) { return; } RazorFormat.ProcessRazorPage(httpReq, contentPage, null, httpRes); }
public RazorPage(RazorFormat razorFormat, string fullPath, string name, string contents) : this(razorFormat, fullPath, name, contents, RazorPageType.ViewPage) { }
public string RenderToString <T>(T model) { var template = RazorFormat.ExecuteTemplate(model, this.PageName, this.TemplatePath); return(template.Result); }