c# - Intercept object arrives Controller -
i have controllers get/post methods , wondering if it's possible intercept object before reach post method on controller.
here method on controller:
[route("{type}")] [httppost] public httpresponsemessage save(string type, [frombody] message message) { .... return request.createresponse((httpstatuscode)200, result); }
is possible intercept object message before method save() has been called? i've created delegatinghandler it's not working.
here how i've added route:
ihttproute route = globalconfiguration.configuration.routes.createroute( routetemplate: "api/message/{type}", defaults: new httproutevaluedictionary("route"), constraints: null, datatokens: null, handler: new validationhandler()); globalconfiguration.configuration.routes.add("myroute", route);
any ideas how can it?
if have created delegatinghandler
need configure follows:
globalconfiguration.configuration .messagehandlers .add(new foohandler());
Comments
Post a Comment