/// <summary>
        /// Check if this segment is equal to another.
        /// </summary>
        /// <param name="other">The other segment to check.</param>
        /// <returns>True if the other segment is equal.</returns>
        /// <exception cref="System.ArgumentNullException">Throws if the input other is null.</exception>
        internal override bool Equals(ODataPathSegment other)
        {
            ExceptionUtils.CheckArgumentNotNull(other, "other");
            NavigationPropertyLinkSegment otherLinkSegment = other as NavigationPropertyLinkSegment;

            return(otherLinkSegment != null && otherLinkSegment.NavigationProperty == this.navigationProperty);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Visit a NavigationPropertyLinkSegment
        /// </summary>
        /// <param name="segment">the segment to Translate</param>
        /// <returns>Translated WebApi path segment.</returns>
        public override IEnumerable <ODataPathSegment> Translate(Semantic.NavigationPropertyLinkSegment segment)
        {
            yield return(new NavigationPathSegment(segment.NavigationProperty));

            yield return(new RefPathSegment());
        }
 /// <summary>
 /// Determine the NavigationSource of a NavigationPropertyLinkSegment
 /// </summary>
 /// <param name="segment">The NavigationPropertyLinkSegment to look in.</param>
 /// <returns>The IEdmNavigationSource of this NavigationPropertyLinkSegment</returns>
 /// <exception cref="System.ArgumentNullException">Throws if the input segment is null.</exception>
 public override IEdmNavigationSource Translate(NavigationPropertyLinkSegment segment)
 {
     ExceptionUtils.CheckArgumentNotNull(segment, "segment");
     return(segment.NavigationSource);
 }