BHoM / BHoM/BHoM_Engine

BHoM_Engine: `TryGetValue(this FragmentSet fragmentSet, Type fragmentType, out IFragment fragment)` should look for matches for derived Fragment types

Open
#2,646 0 comments 0 reactions 1 assignee Claimed by @alelom View on GitHub
type:bug
Dominant language
C#
Stars
30
Forks
13
Avg merge
7d 10h
Merged PRs (30d)
5

Description

#### Description:

Currently, `TryGetValue(this FragmentSet fragmentSet, Type fragmentType, out IFragment fragment)` only checks if exactly the specified Fragment type is found in the fragmentSet. However, a valid approach is to call it by passing in `fragmentType` something like `typeof(IPersistentId)`. In case multiple matches are found, an error should be returned. Currently, the function returns no match at all for that scenario, even if the FragmentSet has a Fragment that inherit from `IPersistentId`, which is not correct.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.