예제 #1
0
        /// <summary>
        /// Check if this segment is equal to another segment.
        /// </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");
            SingletonSegment otherSingleton = other as SingletonSegment;

            return(otherSingleton != null && otherSingleton.singleton == this.Singleton);
        }
예제 #2
0
 /// <summary>
 /// Translate an SingletonSegment
 /// </summary>
 /// <param name="segment">the segment to Translate</param>
 /// <returns>Translated WebApi path segment.</returns>
 public override IEnumerable <ODataPathSegment> Translate(Semantic.SingletonSegment segment)
 {
     yield return(new SingletonPathSegment(segment.Singleton));
 }
 /// <summary>
 /// Determine the NavigationSource of a SingletonSegment
 /// </summary>
 /// <param name="segment">The SingletonSegment to look in.</param>
 /// <returns>The IEdmNavigationSource of this SingletonSegment</returns>
 /// <exception cref="System.ArgumentNullException">Throws if the input segment is null.</exception>
 public override IEdmNavigationSource Translate(SingletonSegment segment)
 {
     ExceptionUtils.CheckArgumentNotNull(segment, "segment");
     return(segment.Singleton);
 }