C# Class ServiceStack.Razor.Managers.RazorPageResolver

A common hook into ServiceStack and the hosting infrastructure used to resolve requests.
Inheritance: ServiceStack.Host.Handlers.ServiceStackHandlerBase, IViewEngine
Exibir arquivo Open project: nustack/ServiceStack Class Usage Examples

Public Methods

Method Description
CatchAllHandler ( string httpmethod, string pathInfo, string filepath ) : IHttpHandler
CreateRequest ( IRequest request, string operationName ) : object
EnsureCompiled ( ServiceStack.Razor.Managers.RazorPage page, IResponse response ) : void
FindRazorPage ( IRequest httpReq, object model ) : ServiceStack.Razor.Managers.RazorPage
GetResponse ( IRequest httpReq, object request ) : object
HasView ( string viewName, IRequest httpReq = null ) : bool
ProcessRequest ( IRequest httpReq, IResponse httpRes, object dto ) : bool

Called by the HtmlFormat:IPlugin who checks to see if any registered view engines can handle the response DTO. If this view engine can handle the response DTO, then process it, otherwise, returning false will allow another view engine to attempt to process it. If no view engines can process the DTO, HtmlFormat will simply handle it itself.

ProcessRequest ( IRequest httpReq, IResponse httpRes, string operationName ) : void

This is called by the hosting environment via CatchAll usually for content pages.

RazorPageResolver ( IRazorConfig config, RazorViewManager viewManager ) : System
RenderPartial ( string pageName, object model, bool renderHtml, StreamWriter writer, HtmlHelper htmlHelper ) : string
ResolveAndExecuteRazorPage ( IRequest httpReq, IResponse httpRes, object model, ServiceStack.Razor.Managers.RazorPage razorPage = null ) : IRazorView

Private Methods

Method Description
CreateRazorPageInstance ( IRequest httpReq, IResponse httpRes, object dto, ServiceStack.Razor.Managers.RazorPage razorPage ) : IRazorView
ExecuteRazorPageWithLayout ( IRequest httpReq, IResponse httpRes, object model, IRazorView page, Func layout ) : string>.Tuple
PrepareAndSetModel ( IRazorView page, IRequest httpReq, object dto ) : void

Method Details

CatchAllHandler() public method

public CatchAllHandler ( string httpmethod, string pathInfo, string filepath ) : IHttpHandler
httpmethod string
pathInfo string
filepath string
return IHttpHandler

CreateRequest() public method

public CreateRequest ( IRequest request, string operationName ) : object
request IRequest
operationName string
return object

EnsureCompiled() public method

public EnsureCompiled ( ServiceStack.Razor.Managers.RazorPage page, IResponse response ) : void
page ServiceStack.Razor.Managers.RazorPage
response IResponse
return void

FindRazorPage() public method

public FindRazorPage ( IRequest httpReq, object model ) : ServiceStack.Razor.Managers.RazorPage
httpReq IRequest
model object
return ServiceStack.Razor.Managers.RazorPage

GetResponse() public method

public GetResponse ( IRequest httpReq, object request ) : object
httpReq IRequest
request object
return object

HasView() public method

public HasView ( string viewName, IRequest httpReq = null ) : bool
viewName string
httpReq IRequest
return bool

ProcessRequest() public method

Called by the HtmlFormat:IPlugin who checks to see if any registered view engines can handle the response DTO. If this view engine can handle the response DTO, then process it, otherwise, returning false will allow another view engine to attempt to process it. If no view engines can process the DTO, HtmlFormat will simply handle it itself.
public ProcessRequest ( IRequest httpReq, IResponse httpRes, object dto ) : bool
httpReq IRequest
httpRes IResponse
dto object
return bool

ProcessRequest() public method

This is called by the hosting environment via CatchAll usually for content pages.
public ProcessRequest ( IRequest httpReq, IResponse httpRes, string operationName ) : void
httpReq IRequest
httpRes IResponse
operationName string
return void

RazorPageResolver() public method

public RazorPageResolver ( IRazorConfig config, RazorViewManager viewManager ) : System
config IRazorConfig
viewManager RazorViewManager
return System

RenderPartial() public method

public RenderPartial ( string pageName, object model, bool renderHtml, StreamWriter writer, HtmlHelper htmlHelper ) : string
pageName string
model object
renderHtml bool
writer System.IO.StreamWriter
htmlHelper HtmlHelper
return string

ResolveAndExecuteRazorPage() public method

public ResolveAndExecuteRazorPage ( IRequest httpReq, IResponse httpRes, object model, ServiceStack.Razor.Managers.RazorPage razorPage = null ) : IRazorView
httpReq IRequest
httpRes IResponse
model object
razorPage ServiceStack.Razor.Managers.RazorPage
return IRazorView