static bool IsDefault(object o) { if (o == null) { return true; } //Check is type os object is ValueType if (o.GetType().IsValueType) { return Activator.CreateInstance(o.GetType()).Equals(o); } //ReferenceType return false; }
Also can be implemented as extension.
No comments:
Post a Comment