/// <summary> /// Determines whether the given type is a primitive type or /// is a <see cref="string" />, <see cref="DateTime" />, <see cref="Decimal" />, /// <see cref="Guid" />, <see cref="DateTimeOffset" /> or <see cref="TimeSpan" />. /// </summary> /// <param name="type">The type</param> /// <returns><c>true</c> if the type is a primitive type.</returns> internal static bool IsQueryPrimitiveType(Type type) { Contract.Requires(type != null); type = GetInnerMostElementType(type); return(type.IsEnum || type.IsPrimitive || type == typeof(Uri) || (EdmLibHelpers.GetEdmPrimitiveTypeOrNull(type) != null)); }