Advertisement
Guest User

Untitled

a guest
Jan 14th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement