title: Calling methods with different parameters using a map instead of switch/if else
body: <p>I am working a c# method which calls different methods based on some conditions and I am wondering if I can do this without switch or if else statements.
  Below is the code I have</p>
  
  <pre><code>if (msg== atype)
  {
      _aHandler.HandleAType(msg, TopicType.A);
  }
  else if (msg== btype)
  {
      _
      _btype.HandleBType(msg, TopicType.B);
  }
  else if (msg== ctype)
  {
      _cHandler.HandleC(msg);
  }
  else if (msg== dtype)
  {
      _dHandler.HandleDType(msg);
  }
  
  else
      _logger.Error($"No matching type found for {msg}");
  </code></pre>
  
  <p>Please note that I have different methods with different types of parameters in each condition.</p>
  
  <p><strong>Is there a better way I can do this without switch/if-else ?</strong></p>