/// <summary> /// Tries to retrieve a record from the group. /// </summary> /// <typeparam name="TMajor">Record type of the group</typeparam> /// <param name="group">Group to retrieve from</param> /// <param name="formKey">FormKey to query for</param> /// <param name="record">Record object, if located</param> /// <returns>True if record retreived from group</returns> public static bool TryGetValue <TMajor>( this IGroupCommonGetter <TMajor> group, FormKey formKey, [MaybeNullWhen(false)] out TMajor record) where TMajor : IMajorRecordCommonGetter, IBinaryItem, IDuplicatable { return(group.RecordCache.TryGetValue(formKey, out record)); }
/// <summary> /// Tries to retrieve a record from the group. /// </summary> /// <typeparam name="TMajor">Record type of the group</typeparam> /// <param name="group">Group to retrieve from</param> /// <param name="formKey">FormKey to query for</param> /// <returns>Record object, if located</returns> public static TMajor?TryGetValue <TMajor>( this IGroupCommonGetter <TMajor> group, FormKey formKey) where TMajor : IMajorRecordCommonGetter { if (group.RecordCache.TryGetValue(formKey, out var record)) { return(record); } return(default);