We separate out extension method classes by primitive types and complex types that we are extending. My question is simple. Would a Guid be considered a primitive type along with string, int, DateTime, etc? Or would it be considered a complex type when describing it?
After reviewing the answers I much appreciate the clarification that I was able to glean from some answers. However, I am getting the impression that curiosity killed the cat got the cat murdered, so I am voting to close my own question.
It depends on what you call a "primitive data type".
Wikipedia lists these two definitions:
According to the first one, Guid
is a constructed type, not a primitive.
According to the second, it is also not a primitive type (as it is provided in the BCL, in the System
namespace, and is not defined by any of the .NET languages).
Update:
This is what the IsPrimitive
method of the Type
class says:
The primitive types are Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, and Single.
So, as far as .NET is concerned, it is not a primitive type.
In conclusion: According to the three separate criteria above, Guid
is definitely not a primitive type.