public static FormLink <TMajorGetter> Relink <TMajorGetter>(this FormLink <TMajorGetter> link, IReadOnlyDictionary <FormKey, FormKey> mapping) where TMajorGetter : class, IMajorRecordCommonGetter { if (!link.IsNull && mapping.TryGetValue(link.FormKey, out var replacement)) { return(new FormLink <TMajorGetter>(replacement)); } return(link); }
/// <summary> /// Compares equality of two links, where rhs is a non nullable link. /// </summary> /// <param name="other">Other link to compare to</param> /// <returns>True if FormKey members are equal</returns> public bool Equals(FormLink <TMajorGetter> other) => EqualityComparer <FormKey?> .Default.Equals(this.FormKeyNullable, other.FormKey);
/// <summary> /// Compares equality of two links. /// </summary> /// <param name="other">Other link to compare to</param> /// <returns>True if FormKey members are equal</returns> public bool Equals(FormLink <TMajorGetter> other) => this.FormKey.Equals(other.FormKey);
/// <summary> /// Compares equality of two links, where rhs is a non nullable link. /// </summary> /// <param name="other">Other link to compare to</param> /// <returns>True if FormKey members are equal</returns> public bool Equals(FormLink <TMajorGetter>?other) => EqualityComparer <FormKey?> .Default.Equals(this._formKey, other?.FormKey);