ServiceStack.Razor.RazorFormat.ProcessRazorPage C# (CSharp) Method

ProcessRazorPage() public method

public ProcessRazorPage ( IRequest httpReq, ServiceStack.Razor.Managers.RazorPage contentPage, object model, IResponse httpRes ) : void
httpReq IRequest
contentPage ServiceStack.Razor.Managers.RazorPage
model object
httpRes IResponse
return void
        public void ProcessRazorPage(IRequest httpReq, RazorPage contentPage, object model, IResponse httpRes)
        {
            PageResolver.ResolveAndExecuteRazorPage(httpReq, httpRes, model, contentPage);
        }

Usage Example

Esempio n. 1
0
        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);
        }
All Usage Examples Of ServiceStack.Razor.RazorFormat::ProcessRazorPage