/// <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);
 }
Пример #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));
 }
Пример #5
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<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);
 }
Пример #9
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)
        {
            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);
 }
Пример #11
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<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);
 }
Пример #13
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<FunctionAnnotation>(other, o => o.Function == this.Function && o.FunctionImport == this.FunctionImport);
 }
Пример #14
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<EntitySetAnnotation>(
         other, o => o.EntitySet == this.EntitySet && o.EdmEntitySet == this.EdmEntitySet);
 }
Пример #15
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 <IsMediaLinkEntryAnnotation>(other, o => true));
 }