我有一个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;
答案 0 :(得分:0)
@Sukhvinder Uppal
我认为这是在同步后解决的。对?