/// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return(this.CastAndCheckEquality <PayloadOrderODataPayloadElementAnnotation>(other, (o) =>
     {
         return o.StringRepresentation == this.StringRepresentation;
     }));
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<PayloadOrderODataPayloadElementAnnotation>(other, (o) =>
         {
             return o.StringRepresentation == this.StringRepresentation;
         });
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation.
 /// </summary>
 /// <param name="other">The annotation to compare to.</param>
 /// <returns>True if the annotations are equivalent, false otherwise.</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<NamedStreamAtomLinkMetadataAnnotation>(
         other,
         (a) => a.Href == this.Href && 
                a.HrefLang == this.HrefLang && 
                a.Length == this.Length && 
                a.Relation == this.Relation && 
                a.Title == this.Title && 
                a.Type == this.Type);
 }
Exemple #4
0
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation.
 /// </summary>
 /// <param name="other">The annotation to compare to.</param>
 /// <returns>True if the annotations are equivalent, false otherwise.</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return(this.CastAndCheckEquality <NamedStreamAtomLinkMetadataAnnotation>(
                other,
                (a) => a.Href == this.Href &&
                a.HrefLang == this.HrefLang &&
                a.Length == this.Length &&
                a.Relation == this.Relation &&
                a.Title == this.Title &&
                a.Type == this.Type));
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<TitleAnnotation>(other, o => o.Value == this.Value);
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation.
 /// </summary>
 /// <param name="other">The annotation to compare to.</param>
 /// <returns>True if the annotations are equivalent, false otherwise.</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return(this.CastAndCheckEquality <SerializationTypeNameTestAnnotation>(
                other,
                (a) => a.TypeName == this.TypeName));
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation.
 /// </summary>
 /// <param name="other">The annotation to compare to.</param>
 /// <returns>True if the annotations are equivalent, false otherwise.</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<SerializationTypeNameTestAnnotation>(
         other,
         (a) => a.TypeName == this.TypeName);
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<MemberPropertyAnnotation>(other, o => o.Property == this.Property);
 }
        /// <summary>
        /// Returns whether or not the given annotation is equal to the current annotation
        /// </summary>
        /// <param name="other">The annotation to compare to</param>
        /// <returns>True if the annotations are equivalent, false otherwise</returns>
        public override bool Equals(ODataPayloadElementEquatableAnnotation other)
        {
            ExceptionUtilities.CheckObjectNotNull(this.ValueEqualityFunc, "Value equality callback must not be null");
            return this.CastAndCheckEquality<XmlTreeAnnotation>(
                other,
                tree =>
                {
                    if (this.IsAttribute != tree.IsAttribute)
                    {
                        return false;
                    }

                    if (this.LocalName != tree.LocalName)
                    {
                        return false;
                    }

                    if (this.NamespaceName != tree.NamespaceName)
                    {
                        return false;
                    }

                    if (this.NamespacePrefix != tree.NamespacePrefix)
                    {
                        return false;
                    }

                    if (!this.ValueEqualityFunc(this.PropertyValue, tree.PropertyValue))
                    {
                        return false;
                    }

                    if (this.Children.Count != tree.Children.Count)
                    {
                        return false;
                    }

                    var remainingChildren = tree.Children.ToList();
                    foreach (var child in this.Children)
                    {
                        var match = remainingChildren.FirstOrDefault(c => child.Equals(c));
                        if (match == null)
                        {
                            return false;
                        }

                        remainingChildren.Remove(match);
                    }

                    return true;
                });
        }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<IsMediaLinkEntryAnnotation>(other, o => true);
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<DataTypeAnnotation>(other, o => o.DataType.Equals(this.DataType) && o.EdmDataType.Equals(this.EdmDataType));
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<CollectionNameAnnotation>(other, o => o.Name == this.Name);
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<FunctionAnnotation>(other, o => o.Function == this.Function && o.FunctionImport == this.FunctionImport);
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return this.CastAndCheckEquality<EntitySetAnnotation>(
         other, o => o.EntitySet == this.EntitySet && o.EdmEntitySet == this.EdmEntitySet);
 }
 /// <summary>
 /// Returns whether or not the given annotation is equal to the current annotation
 /// </summary>
 /// <param name="other">The annotation to compare to</param>
 /// <returns>True if the annotations are equivalent, false otherwise</returns>
 public override bool Equals(ODataPayloadElementEquatableAnnotation other)
 {
     return(this.CastAndCheckEquality <IsMediaLinkEntryAnnotation>(other, o => true));
 }