/// <summary>
 /// The property that the thing-type can be ordered by in the result.
 /// </summary>
 public ThingTypeProperty(
     string name,
     string type,
     string xpath,
     IItemTypePropertyConversion conversion = null)
 {
     Name       = name;
     Type       = type;
     _xpath     = xpath;
     Conversion = conversion;
 }
        /// <summary>
        /// This method converts the Property xml to the
        /// ThingTypeProperty object.
        /// </summary>
        public static ThingTypeProperty CreateFromXml(XPathNavigator propertyNav)
        {
            string name  = propertyNav.GetAttribute("name", string.Empty);
            string type  = propertyNav.GetAttribute("type", string.Empty);
            string xpath = propertyNav.GetAttribute("xpath", string.Empty);
            IItemTypePropertyConversion conversion = null;

            XPathNavigator conversionNav = propertyNav.SelectSingleNode("conversion/linear-conversion");

            if (conversionNav != null)
            {
                conversion = LinearItemTypePropertyConversion.CreateFromXml(conversionNav);
            }

            return(new ThingTypeProperty(name, type, xpath, conversion));
        }