/// <summary>
        /// Returns the text representation of the current object.
        /// </summary>
        /// <param name="type">Reference to the calling object.</param>
        /// <returns>The text representation of the current object.</returns>
        public static string ToTraceString(this IEdmTypeReference type)
        {
            EdmUtil.CheckArgumentNull(type, "type");
            StringBuilder sb = new StringBuilder();
            sb.Append('[');
            if (type.Definition != null)
            {
                sb.Append(type.Definition.ToTraceString());
                sb.AppendKeyValue(EdmConstants.FacetName_Nullable, type.IsNullable.ToString());
                if (type.IsPrimitive())
                {
                    sb.AppendFacets(type.AsPrimitive());
                }
            }

            sb.Append(']');
            return sb.ToString();
        }