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);
}