title: Factory pattern, Avoid same switch case for different interface
body: <p>I have a Model which Implements 3 different interfaces</p>
  
  <pre><code>public class CustomerRateSettingModel :  IBaseFactory, IHandleSearch, IHandleSearchAggregate
  </code></pre>
  
  <p>I am very new with implementing design patterns and trying to implement Factory pattern to create instances.
  But I am unable to find a proper way to avoid the identical Switch statements while writing Factory</p>
  
  <pre><code>  public static IHandleSearch GetClassInstanceForSearch(string className)
      {
          switch (className.ToLower())
          {
              case "customerratesettingmodel":
                  return new CustomerRateSettingModel();
  
              default: return null;
          }
      }
  
      private static IBaseFactory ManufactureModel(string className)
      {
          switch (className.ToLower())
          {
              case "customerratesettingmodel":
                  return new CustomerRateSettingModel();
  
              default: return null;
          }
      }
  </code></pre>
  
  <p>Is there is any right way to handle scenarios like that? </p>
  
  <p>For Reference : 
  the code calling the factory</p>
  
  <pre><code>  IHandleSearch instance = ModelFactory.GetClassInstanceForSearch(modelName);
  
  
   var modelResult = instance.GetSearch(indexName, searchHistory.SearchParameters);
  </code></pre>