public bool IsPrimitive(object value) { if (value == null) throw new ArgumentNullException("value"); return Type.GetTypeCode(value.GetType()) != TypeCode.Object; }