public FindByPathInfo ( string pathInfo ) : ServiceStack.Razor.Managers.RazorPage | ||
pathInfo | string | |
Résultat | ServiceStack.Razor.Managers.RazorPage |
public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName) { httpRes.ContentType = ContentType.Html; if (RazorFormat == null) { RazorFormat = RazorFormat.Instance; } var contentPage = RazorPage ?? RazorFormat.FindByPathInfo(PathInfo); if (contentPage == null) { httpRes.StatusCode = (int)HttpStatusCode.NotFound; httpRes.EndHttpRequest(); return; } if (RazorFormat.WatchForModifiedPages) { RazorFormat.ReloadIfNeeeded(contentPage); } //Add good caching support //if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes)) // return; var modelType = RazorPage != null?RazorPage.GetRazorTemplate().ModelType : null; var model = modelType == null || modelType == typeof(DynamicRequestObject) ? null : DeserializeHttpRequest(modelType, httpReq, httpReq.ContentType); RazorFormat.ProcessRazorPage(httpReq, contentPage, model, httpRes); }
public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName) { httpRes.ContentType = ContentType.Html; if (RazorFormat == null) { RazorFormat = RazorFormat.Instance; } var contentPage = RazorPage ?? RazorFormat.FindByPathInfo(PathInfo); if (contentPage == null) { httpRes.StatusCode = (int)HttpStatusCode.NotFound; httpRes.EndHttpRequest(); return; } var model = Model; if (model == null) { httpReq.Items.TryGetValue("Model", out model); } if (model == null) { var modelType = RazorPage != null ? RazorPage.ModelType : null; model = modelType == null || modelType == typeof(DynamicRequestObject) ? null : DeserializeHttpRequest(modelType, httpReq, httpReq.ContentType); } RazorFormat.ProcessRazorPage(httpReq, contentPage, model, httpRes); }