Advertisement
afterlife88

Untitled

Dec 6th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1.    public Dictionary<string, Func<string, string>> CreateDictionary()
  2.         {
  3.             var dictionary = new Dictionary<string, Func<string, string>>
  4.                                  {
  5.                                      {"/bash", _valueProcessor.Bash},
  6.                                      {"/weather", _valueProcessor.Weather},
  7.                                      {"/ExchangeRates", _valueProcessor.Rates},
  8.                                  
  9.                                  };
  10.             return dictionary;
  11.         }
  12.  
  13.         public static string ReturnAction(string name)
  14.         {
  15.             return _dictionary[name].Invoke(name);
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement