asp.net - Passing variable from web api controller method to filter -


I want to send AppID variable value to filter

  // receive API / Filters [custom filters] Public IEnumerable & lt; String & gt; Get () {var appId = 123; New string return [] {"value1", "value2"}; }  

I can use either OnActionExecuting or OnActionExecuted Method

  public override void OnActionExecuting (HttpActionContext actionContext) {base.OnActionExecuting (actionContext); // Here I know to reach} like  

I how to use querystring

parameter value to reach AppID value

controller action method, set the value of properties request object dictionary, thus: Request.Properties [ "AppId" ] = 123.;

in OnActionExecuted filter method, retrieve it like this: actionContext.Request.Properties [ "AppId"] .

Biteedblu, if you set values ​​in action mode, you must use a filter to On Akshnaksaikted method.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -