RazorPageResolver
A common hook into ServiceStack and the hosting infrastructure used to resolve requests.
Assembly: ServiceStack.Razor.dll
View Source
public class RazorPageResolver : ServiceStackHandlerBase, IHttpAsyncHandler, IHttpHandler, IServiceStackHandler, IViewEngine
Properties
MinifyHtml
View Source
public bool MinifyHtml { get; set; }
UseAdvancedCompression
View Source
public bool UseAdvancedCompression { get; set; }
RenderPartialFn
View Source
public RenderPartialDelegate RenderPartialFn { get; set; }
Inherited Properties
HandlerAttributes
View Source
public RequestAttributes HandlerAttributes { get; set; }
IsReusable
View Source
public override bool IsReusable { get; }
Fields
Log
View Source
public static ILog Log
DefaultLayoutName
View Source
public const string DefaultLayoutName = "_Layout"
Methods
CatchAllHandler(String, String, String)
View Source
public IHttpHandler CatchAllHandler(string httpmethod, string pathInfo, string filepath)
Returns
System.Web.IHttpHandler
Parameters
Type | Name |
---|---|
System.String | httpmethod |
System.String | pathInfo |
System.String | filepath |
ProcessRequestAsync(IRequest, IResponse, String)
This is called by the hosting environment via CatchAll usually for content pages.
View Source
public override Task ProcessRequestAsync(IRequest httpReq, IResponse httpRes, string operationName)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
IRequest | httpReq |
IResponse | httpRes |
System.String | operationName |
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
public virtual Task<bool> ProcessRequestAsync(IRequest httpReq, object dto, Stream outputStream)
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
IRequest | httpReq |
System.Object | dto |
System.IO.Stream | outputStream |
ResolveContentPage(IRequest)
View Source
public RazorPage ResolveContentPage(IRequest httpReq)
Returns
ServiceStack.Razor.Managers.RazorPage
Parameters
Type | Name |
---|---|
IRequest | httpReq |
ResolveViewPage(IRequest, Object)
View Source
public RazorPage ResolveViewPage(IRequest httpReq, object model)
Returns
ServiceStack.Razor.Managers.RazorPage
Parameters
Type | Name |
---|---|
IRequest | httpReq |
System.Object | model |
HtmlFilter(String)
View Source
public string HtmlFilter(string html)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | html |
ExecuteRazorPage(IRequest, Stream, Object, RazorPage)
View Source
public IRazorView ExecuteRazorPage(IRequest httpReq, Stream outputStream, object model, RazorPage razorPage)
Returns
Parameters
Type | Name |
---|---|
IRequest | httpReq |
System.IO.Stream | outputStream |
System.Object | model |
ServiceStack.Razor.Managers.RazorPage | razorPage |
HasView(String, IRequest)
View Source
public bool HasView(string viewName, IRequest httpReq = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | viewName |
IRequest | httpReq |
RenderPartial(String, Object, Boolean, StreamWriter, IHtmlContext)
View Source
public virtual string RenderPartial(string pageName, object model, bool renderHtml, StreamWriter writer, IHtmlContext htmlHelper)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | pageName |
System.Object | model |
System.Boolean | renderHtml |
System.IO.StreamWriter | writer |
ServiceStack.Html.IHtmlContext | htmlHelper |
Inherited Methods
AssertAccess(IHttpRequest, IHttpResponse, Feature, String)
View Source
protected bool AssertAccess(IHttpRequest httpReq, IHttpResponse httpRes, Feature feature, string operationName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpRequest | httpReq |
ServiceStack.Web.IHttpResponse | httpRes |
ServiceStack.Feature | feature |
System.String | operationName |
AssertOperationExists(String, Type)
View Source
protected static void AssertOperationExists(string operationName, Type type)
Parameters
Type | Name |
---|---|
System.String | operationName |
System.Type | type |
CreateContentTypeRequestAsync(IRequest, Type, String)
View Source
protected static async Task<object> CreateContentTypeRequestAsync(IRequest httpReq, Type requestType, string contentType)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
System.Type | requestType |
System.String | contentType |
DeserializeHttpRequestAsync(Type, IRequest, String)
View Source
public static Task<object> DeserializeHttpRequestAsync(Type operationType, IRequest httpReq, string contentType)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
System.Type | operationType |
ServiceStack.Web.IRequest | httpReq |
System.String | contentType |
ExecuteService(Object, IRequest)
View Source
protected static object ExecuteService(object request, IRequest httpReq)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | request |
ServiceStack.Web.IRequest | httpReq |
GetCustomRequestFromBinder(IRequest, Type)
View Source
protected static object GetCustomRequestFromBinder(IRequest httpReq, Type requestType)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
System.Type | requestType |
GetOperationType(String)
View Source
public static Type GetOperationType(string operationName)
Returns
System.Type
Parameters
Type | Name |
---|---|
System.String | operationName |
GetResponseAsync(IRequest, Object)
View Source
public virtual Task<object> GetResponseAsync(IRequest httpReq, object request)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
System.Object | request |
HandleResponse(IRequest, IResponse, Object)
View Source
public async Task HandleResponse(IRequest httpReq, IResponse httpRes, object response)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
ServiceStack.Web.IResponse | httpRes |
System.Object | response |
UpdateResponseContentType(IRequest, Object)
View Source
public void UpdateResponseContentType(IRequest httpReq, object response)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
System.Object | response |
WriteDebugResponse(IResponse, Object)
View Source
public Task WriteDebugResponse(IResponse httpRes, object response)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IResponse | httpRes |
System.Object | response |
Implements
System.Web.IHttpAsyncHandler
System.Web.IHttpHandler
- ServiceStack.Host.Handlers.IServiceStackHandler
- ServiceStack.Html.IViewEngine