title: can "is" operator be factorized in c#?
body: <p>I want to use <code>is</code> operator in <a href="/questions/tagged/c%23" class="post-tag" title="show questions tagged &#39;c#&#39;" rel="tag">c#</a> condition statement. my code is like this:</p>
  
  <pre><code> public static string returnProperColumnValue(string columnName, object columnValue)
   {
      if (columnValue is int || columnValue is float || columnValue is long || ..... ))
      {
          return columnValue.ToString();
      }
      else if (columnValue is string)
      {
          return "'" + columnValue + "'";
      }
      else if (columnValue.GetType().IsGenericType &amp;&amp; columnValue is IDictionary)
      {
          var dictionaryType = columnValue.GetType().GetGenericArguments().First().Name;
  
          //to do
          return "";
      }
      else if (columnValue.GetType().IsGenericType &amp;&amp; (columnValue is IEnumerable))
      {
          var listType = columnValue.GetType().GetGenericArguments().Single().Name;
  
          if (listType is int || ....... )
              return columnName + "+" + "[" + columnValue.ToString() + "]";
          else if (listType is string)
              return columnName + "+" + "{'" + columnValue.ToString() + "'} ";
      }
      return "";
  }
  </code></pre>
  
  <p>I want to check lots of <code>variable types</code> in the <code>if</code> clause.
  Therefore, I want to use <code>is</code> operator in shorter way like this:</p>
  
  <pre><code>public void properColumnValue(object columnValue)
  {
      if (columnValue is ( int || decimal || ... ) )
      {
          //do stuff for int
      } 
  
      //other conditions
  }
  </code></pre>
  
  <p>Is it possible to factorize the <code>is</code> operation?</p>