/// <summary> /// Retrieves a collection that represents all the properties defined on a specified <paramref name="type"/> except those defined on <typeparamref name="T"/>. /// </summary> /// <typeparam name="T">The type to exclude properties on <paramref name="type"/>.</typeparam> /// <param name="type">The type that contains the properties to include except those defined on <typeparamref name="T"/>.</param> /// <returns>A collection of properties for the specified <paramref name="type"/> except those defined on <typeparamref name="T"/>.</returns> public static IEnumerable <PropertyInfo> GetRuntimePropertiesExceptOf <T>(this Type type) { var baseProperties = typeof(T).GetRuntimeProperties(); var typeProperties = type.GetRuntimeProperties(); return(typeProperties.Except(baseProperties, DynamicEqualityComparer.Create <PropertyInfo>(pi => $"{pi.Name}-{pi.PropertyType.Name}".GetHashCode32(), (x, y) => x.Name == y.Name && x.PropertyType.Name == y.PropertyType.Name))); }
/// <summary> /// Determines whether the <see cref="IndexProvisionCollection" /> contains a specific value. /// </summary> /// <param name="provision">The <see cref="IndexProvision"/> to locate in the <see cref="IndexProvisionCollection" />.</param> /// <returns><c>true</c> if <paramref name="provision" /> is found in the <see cref="IndexProvisionCollection" />; otherwise, <c>false</c>.</returns> public override bool Contains(IndexProvision provision) { return(Contains(provision, DynamicEqualityComparer.Create <IndexProvision>(ix => ix.IndexName.GetHashCode(), (i1, i2) => i1.IndexName.GetHashCode() == i2.IndexName.GetHashCode()))); }
/// <summary> /// Determines whether the <see cref="SecondaryIndexCollection{T}" /> contains a specific value. /// </summary> /// <param name="index">The <see cref="SecondaryIndex"/> to locate in the <see cref="SecondaryIndexCollection{T}" />.</param> /// <returns><c>true</c> if <paramref name="index" /> is found in the <see cref="SecondaryIndexCollection{T}" />; otherwise, <c>false</c>.</returns> public override bool Contains(T index) { return(Contains(index, DynamicEqualityComparer.Create <SecondaryIndex>(ix => ix.IndexName.GetHashCode(), (i1, i2) => i1.IndexName.GetHashCode() == i2.IndexName.GetHashCode()))); }