예제 #1
0
 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);
 }
예제 #2
0
 /// <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);
예제 #3
0
 /// <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);
예제 #4
0
 /// <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);