if (!t.IsPrimitive
|| t != typeof (System.Decimal)
|| t != typeof (System.String)
|| t != typeof(System.DateTime)
|| t != typeof (System.DateTime?))
should be
if (!t.IsPrimitive
&& t != typeof (System.Decimal)
&& t != typeof (System.String)
&& t != typeof(System.DateTime)
&& t != typeof (System.DateTime?))
As is, your conditional will always evaluate to true since all types are either not System.String
or not System.Decimal
and you are combining them with the OR operator.