title: Factory based on Typeof or is a
body: <p>What's a more elegant way of having the code below where i want to return a derived class based on the type of another class.</p>
  
  <pre><code>            if (option_ is Rectangle)
              {
                  modelInputs = new Foo();
              }
              else if (option_ is Circle)
              {
                  modelInputs = new Bar();
              }
              else if (option_ is Triangle)
              {
                  modelInputs = new Bar2();
              }
  </code></pre>