OData API的限制处理程序

时间:2015-11-03 20:31:06

标签: odata

我有一个OData API可以正常工作并返回预期的结果。当我使用OData Route添加从DeletgatingHandler派生的ThrottlingHandler()时,它会抛出错误:

500内部服务器错误

响应不包含任何数据。

OData路线:     var builder = new ODataConventionModelBuilder();     builder.EntitySet(ControllerResources.Session);     var model = builder.GetEdmModel();

var pathHandler = new DefaultODataPathHandler();
var routingConventions = ODataRoutingConventions.CreateDefault();
var routeConstraint = new ODataPathRouteConstraint(pathHandler, model, Area,   routingConventions);

var route = new ODataRoute(ControllerResources.ODataRoutePrefix,  routeConstraint, new HttpRouteValueDictionary(), new HttpRouteValueDictionary(),    new HttpRouteValueDictionary(),  **new ThrottlingHandler()**);

routes.Add(Area, route);

ThrottlingHandler():DelegateHandler

returnValue = base.SendAsync(request, cancellationToken);

return returnValue;

1 个答案:

答案 0 :(得分:0)

@Sukhvinder Uppal

我认为这是在同步后解决的。对?