/// <summary>
        /// Handle $ref segment
        /// </summary>
        /// <param name="previous">previous segment info.</param>
        /// <returns>The links segment info</returns>
        private static SegmentInfo CreateEntityReferenceLinkSegment(SegmentInfo previous)
        {
            Debug.Assert(previous.TargetKind == RequestTargetKind.Resource, "Can we ever get here?");
            WebUtil.CheckSyntaxValid(previous.TargetKind == RequestTargetKind.Resource);
            CheckSingleResult(previous.SingleResult, previous.Identifier);

            return(new SegmentInfo(previous)
            {
                Identifier = XmlConstants.UriLinkSegment, TargetKind = RequestTargetKind.Link,
            });
        }