コード例 #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");
            ReferenceSegment otherSegment = other as ReferenceSegment;

            return(otherSegment != null && otherSegment.TargetEdmNavigationSource == this.TargetEdmNavigationSource);
        }
コード例 #2
0
 /// <summary>
 /// Translate a ReferenceSegment
 /// </summary>
 /// <param name="segment">the segment to Translate</param>
 /// <returns>Defined by the implementer.</returns>
 public override string Translate(ReferenceSegment segment)
 {
     // How a ReferenceSegment should be addressed in the context URI is still a pending decision.
     // https://github.com/OData/odata.net/issues/1292
     return(string.Empty);
 }
コード例 #3
0
 /// <summary>
 /// Translate a ReferenceSegment
 /// </summary>
 /// <param name="segment">the segment to Translate</param>
 /// <returns>UserDefinedValue</returns>
 /// <exception cref="System.ArgumentNullException">Throws if the input segment is null.</exception>
 public override bool Translate(ReferenceSegment segment)
 {
     ExceptionUtils.CheckArgumentNotNull(segment, "segment");
     return(!segment.SingleResult);
 }
コード例 #4
0
 /// <summary>
 /// Handle a ReferenceSegment
 /// </summary>
 /// <param name="segment">the segment to Handle</param>
 public override void Handle(ReferenceSegment segment)
 {
     CommonHandler(segment);
 }
コード例 #5
0
 /// <summary>
 /// Translate a ReferenceSegment
 /// </summary>
 /// <param name="segment">the segment to Translate</param>
 /// <returns>Defined by the implementer.</returns>
 public virtual T Translate(ReferenceSegment segment)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 /// <summary>
 /// Determine the NavigationSource of a ReferenceSegment
 /// </summary>
 /// <param name="segment">The ReferenceSegment to look in.</param>
 /// <returns>null, since $filter doesn't have an navigation source</returns>
 /// <exception cref="System.ArgumentNullException">Throws if the input segment is null.</exception>
 public override IEdmNavigationSource Translate(ReferenceSegment segment)
 {
     ExceptionUtils.CheckArgumentNotNull(segment, "segment");
     return(segment.TargetEdmNavigationSource);
 }
コード例 #7
0
 /// <summary>
 /// Handle a ReferenceSegment
 /// </summary>
 /// <param name="segment">the segment to Handle</param>
 public virtual void Handle(ReferenceSegment segment)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 /// <summary>
 /// Translate a ReferenceSegment
 /// </summary>
 /// <param name="segment">the segment to Translate</param>
 /// <returns>Defined by the implementer.</returns>
 public override string Translate(ReferenceSegment segment)
 {
     Debug.Assert(segment != null, "segment != null");
     return(segment.Identifier);
 }