Simple types are primitive-types and strings - CSharp System

CSharp examples for System:Type

Description

Simple types are primitive-types and strings

Demo Code


using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using System;//from w  w w .  java2 s .  c  o  m

public class Main{
        /// <summary>
      /// Simple types are primitive-types and strings
      /// </summary>
      /// <param name="type"></param>
      /// <returns></returns>
      public static bool IsSimpleType(this Type type)
      {
         return type.IsEnum || type.IsPrimitive || type == typeof(string);
      }
}

Related Tutorials