Skip to main content

RazorPageResolver

A common hook into ServiceStack and the hosting infrastructure used to resolve requests.

Assembly: ServiceStack.Razor.dll
View Source
Declaration
public class RazorPageResolver : ServiceStackHandlerBase, IHttpAsyncHandler, IHttpHandler, IServiceStackHandler, IViewEngine

Properties

MinifyHtml

View Source
Declaration
public bool MinifyHtml { get; set; }

UseAdvancedCompression

View Source
Declaration
public bool UseAdvancedCompression { get; set; }

RenderPartialFn

View Source
Declaration
public RenderPartialDelegate RenderPartialFn { get; set; }

Inherited Properties

HandlerAttributes

View Source
Declaration
public RequestAttributes HandlerAttributes { get; set; }

IsReusable

View Source
Declaration
public override bool IsReusable { get; }

Fields

Log

View Source
Declaration
public static ILog Log

DefaultLayoutName

View Source
Declaration
public const string DefaultLayoutName = "_Layout"

Methods

CatchAllHandler(String, String, String)

View Source
Declaration
public IHttpHandler CatchAllHandler(string httpmethod, string pathInfo, string filepath)
Returns

System.Web.IHttpHandler

Parameters
TypeName
System.Stringhttpmethod
System.StringpathInfo
System.Stringfilepath

ProcessRequestAsync(IRequest, IResponse, String)

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

View Source
Declaration
public override Task ProcessRequestAsync(IRequest httpReq, IResponse httpRes, string operationName)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
IRequesthttpReq
IResponsehttpRes
System.StringoperationName

ProcessRequestAsync(IRequest, Object, Stream)

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.

View Source
Declaration
public virtual Task<bool> ProcessRequestAsync(IRequest httpReq, object dto, Stream outputStream)
Returns

System.Threading.Tasks.Task<System.Boolean>

Parameters
TypeName
IRequesthttpReq
System.Objectdto
System.IO.StreamoutputStream

ResolveContentPage(IRequest)

View Source
Declaration
public RazorPage ResolveContentPage(IRequest httpReq)
Returns

ServiceStack.Razor.Managers.RazorPage

Parameters
TypeName
IRequesthttpReq

ResolveViewPage(IRequest, Object)

View Source
Declaration
public RazorPage ResolveViewPage(IRequest httpReq, object model)
Returns

ServiceStack.Razor.Managers.RazorPage

Parameters
TypeName
IRequesthttpReq
System.Objectmodel

HtmlFilter(String)

View Source
Declaration
public string HtmlFilter(string html)
Returns

System.String

Parameters
TypeName
System.Stringhtml

ExecuteRazorPage(IRequest, Stream, Object, RazorPage)

View Source
Declaration
public IRazorView ExecuteRazorPage(IRequest httpReq, Stream outputStream, object model, RazorPage razorPage)
Returns

ServiceStack.Html.IRazorView

Parameters
TypeName
IRequesthttpReq
System.IO.StreamoutputStream
System.Objectmodel
ServiceStack.Razor.Managers.RazorPagerazorPage

HasView(String, IRequest)

View Source
Declaration
public bool HasView(string viewName, IRequest httpReq = null)
Returns

System.Boolean

Parameters
TypeName
System.StringviewName
IRequesthttpReq

RenderPartial(String, Object, Boolean, StreamWriter, IHtmlContext)

View Source
Declaration
public virtual string RenderPartial(string pageName, object model, bool renderHtml, StreamWriter writer, IHtmlContext htmlHelper)
Returns

System.String

Parameters
TypeName
System.StringpageName
System.Objectmodel
System.BooleanrenderHtml
System.IO.StreamWriterwriter
ServiceStack.Html.IHtmlContexthtmlHelper

Inherited Methods

AssertAccess(IHttpRequest, IHttpResponse, Feature, String)

View Source
Declaration
protected bool AssertAccess(IHttpRequest httpReq, IHttpResponse httpRes, Feature feature, string operationName)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Web.IHttpRequesthttpReq
ServiceStack.Web.IHttpResponsehttpRes
ServiceStack.Featurefeature
System.StringoperationName

AssertOperationExists(String, Type)

View Source
Declaration
protected static void AssertOperationExists(string operationName, Type type)
Parameters
TypeName
System.StringoperationName
System.Typetype

CreateContentTypeRequestAsync(IRequest, Type, String)

View Source
Declaration
protected static async Task<object> CreateContentTypeRequestAsync(IRequest httpReq, Type requestType, string contentType)
Returns

System.Threading.Tasks.Task<System.Object>

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq
System.TyperequestType
System.StringcontentType

DeserializeHttpRequestAsync(Type, IRequest, String)

View Source
Declaration
public static Task<object> DeserializeHttpRequestAsync(Type operationType, IRequest httpReq, string contentType)
Returns

System.Threading.Tasks.Task<System.Object>

Parameters
TypeName
System.TypeoperationType
ServiceStack.Web.IRequesthttpReq
System.StringcontentType

ExecuteService(Object, IRequest)

View Source
Declaration
protected static object ExecuteService(object request, IRequest httpReq)
Returns

System.Object

Parameters
TypeName
System.Objectrequest
ServiceStack.Web.IRequesthttpReq

GetCustomRequestFromBinder(IRequest, Type)

View Source
Declaration
protected static object GetCustomRequestFromBinder(IRequest httpReq, Type requestType)
Returns

System.Object

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq
System.TyperequestType

GetOperationType(String)

View Source
Declaration
public static Type GetOperationType(string operationName)
Returns

System.Type

Parameters
TypeName
System.StringoperationName

GetResponseAsync(IRequest, Object)

View Source
Declaration
public virtual Task<object> GetResponseAsync(IRequest httpReq, object request)
Returns

System.Threading.Tasks.Task<System.Object>

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq
System.Objectrequest

HandleResponse(IRequest, IResponse, Object)

View Source
Declaration
public async Task HandleResponse(IRequest httpReq, IResponse httpRes, object response)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq
ServiceStack.Web.IResponsehttpRes
System.Objectresponse

UpdateResponseContentType(IRequest, Object)

View Source
Declaration
public void UpdateResponseContentType(IRequest httpReq, object response)
Parameters
TypeName
ServiceStack.Web.IRequesthttpReq
System.Objectresponse

WriteDebugResponse(IResponse, Object)

View Source
Declaration
public Task WriteDebugResponse(IResponse httpRes, object response)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IResponsehttpRes
System.Objectresponse

Implements