Guest User

Untitled

a guest
Jan 14th, 2015
146
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected override void OnActionExecuting(ActionExecutingContext filterContext)
  2. {
  3.     var valueProviderResult = filterContext.Controller.ValueProvider.GetValue("<source parameter name>");
  4.  
  5.     //translation here, you can morph the value as you wish
  6.     if (valueProviderResult != null)
  7.     {
  8.         filterContext.ActionParameters["<destination parameter name"] = yourTranslationService(valueProviderResult.AttemptedValue);
  9.     }
  10.    
  11.     base.OnActionExecuting(filterContext);
  12. }
RAW Paste Data