コード例 #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);