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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -