我正在使用ServiceStack的funq,我试图获得在请求结束时处理IOC的位置。特别是对于scope = ReuseScope.Request的条目。
我正在查看RestHandler的ProcessRequest方法,它是由Asp.NET直接调用的方法,它的结尾是这样的:
(...)
if (doJsonp && !(response is CompressedResult))
httpRes.WriteToResponse(httpReq, response, (callback + "(").ToUtf8Bytes(), ")".ToUtf8Bytes());
else
httpRes.WriteToResponse(httpReq, response);
}
catch (Exception ex)
{
if (!EndpointHost.Config.WriteErrorsToResponse) throw;
HandleException(httpReq, httpRes, operationName, ex);
}
}我没有看到任何关于Funq处理的引用。这里我漏掉了什么?谢谢
发布于 2014-02-20 02:31:31
Container作用域与Singleton作用域相同,仅当AppHost is disposed时才被释放。
在ServiceStackHost.OnEndRequest()中部署RequestScoped资源
您可以在AppHost中覆盖AppHost.Release(object instance),以便在ServiceStack释放资源时获得通知。
https://stackoverflow.com/questions/21888402
复制相似问题