title: How to dynamically call a function for the strategy pattern?
body: <p>I am working on a webapplication in .NET Core with Razor Pages (MVVM) with a form where the user can give me 4 options. </p>
  
  <p>Each of those options perform the same action, but just a little bit different in terms of execution - that's why I'd like to implement the strategy pattern. </p>
  
  <p>Is there a way to dynamically generate the function name in some way? It might be a silly question, but I just understand the basics.</p>
  
  <pre><code>// option = A
  // option = B
  // option = C
  // option = D
  
  public async Task&lt;IActionResult&gt; OnPostAsync()
  {
  
      ...
  
      var option = Input.Option // from model
      if(option == "A") {
          A.DoAlgorithm(input)
      } else if(option = "B") {
          B.DoAlgorithm(ïnput)
      } else if(option = "c") {
          C.DoAlgorithm(input) 
      } else {
          D.DoAlgorithm(input) 
      }
  
      ...
  }
  </code></pre>
  
  <p>It feels like I am missing the point here of this pattern if I would do this, so my question is: is there some way to dynamically call a function based on the input option? If I am using the wrong pattern for this, please do correct me. </p>