/// <summary> /// Locate all of a link's target records in given Link Cache.<br /> /// The winning override will be returned first, and finished by the original defining definition. /// </summary> /// <param name="link">Link to resolve</param> /// <param name="cache">Link Cache to resolve against</param> /// <returns>Enumerable of the linked records</returns> /// <typeparam name="TMajor">Major Record type to resolve to</typeparam> public static IEnumerable <TMajor> ResolveAll <TMajor>(this IFormLinkGetter <TMajor> link, ILinkCache cache) where TMajor : class, IMajorRecordCommonGetter { if (!link.FormKeyNullable.TryGet(out var formKey)) { return(Enumerable.Empty <TMajor>()); } return(cache.ResolveAll <TMajor>(formKey)); }
/// <summary> /// Locate all of a link's target records in given Link Cache.<br /> /// The winning override will be returned first, and finished by the original defining definition. /// </summary> /// <param name="link">Link to resolve</param> /// <param name="cache">Link Cache to resolve against</param> /// <returns>Enumerable of the linked records</returns> /// <typeparam name="TMajor">Major Record type to resolve to</typeparam> public static IEnumerable <TMajor> ResolveAll <TMajor>(this IFormLinkGetter <TMajor> link, ILinkCache cache) where TMajor : class, IMajorRecordGetter { if (link.FormKeyNullable is not { } formKey) { return(Enumerable.Empty <TMajor>()); } return(cache.ResolveAll <TMajor>(formKey)); }