/// <summary> /// Compares two DataType instances for equivalence. /// </summary> /// <returns>True if the DataTypes are equivalent, false otherwise.</returns> /// <remarks> /// <para> /// Data type equivalence is looser than data type equality. So two data types /// are equivalent if they are equal, or, in the case of object types, if they /// have the same set of properties, by name and property type equivalence. /// </para> /// </remarks> public static bool Equivalent(DataType a, DataType b) { return a != null && b != null && a.EquivalentTo(b); }
public bool EquivalentTo(PropertyDef other) { return(other != null && _name == other.Name && _propertyType.EquivalentTo(other.PropertyType)); }
/// <summary> /// Compares two DataType instances for equivalence. /// </summary> /// <returns>True if the DataTypes are equivalent, false otherwise.</returns> /// <remarks> /// <para> /// Data type equivalence is looser than data type equality. So two data types /// are equivalent if they are equal, or, in the case of object types, if they /// have the same set of properties, by name and property type equivalence. /// </para> /// </remarks> public static bool Equivalent(DataType a, DataType b) { return(a != null && b != null && a.EquivalentTo(b)); }
public override bool EquivalentTo(DataType other) { var otherList = other as ListType; return(otherList != null && _elementType.EquivalentTo(otherList.ElementType)); }