speckle-sharp
speckle-sharp copied to clipboard
refactor(core): DynamicBase model methods are misleadingly named
GetDynamicMemberNames() is used in the serializer and actually returns names of all properties (both dynamic and typed)
GetDynamicMembers() only return dynamic properties
GetMemberNames() returns names of all properties (except those with SchemaIgnore attribute) and is not used.
The serlializer should use GetMemberNames() and check if there are any instances of GetDynamicMemberNames() outside of Core that may not be used correctly.
@AlanRynne this can be fixed now maybe?
It can once we merge in https://github.com/specklesystems/speckle-sharp/pull/1620, since it contains a better implementation of GetMembers() that should work for all the old cases either by:
- Calling
GetMember(ENUM_OF_THE_DESIRED_MEMBERS)to get a dictionary or - Calling
.Keyson the result to get the member names
This allows us to flag everything else as obsolete except GetDynamicMemberNames which is an override method of DynamicObject.
There's one last minor change around GetInstanceMembers, which has a completely different return type (returns PropInfo classes (reflection) instead of Dictionary<string,object>, and I think we could make it just static and leave it as a utility method.
First part our of 3 to close this issue is done in #1832
Updated the issue message to reflect the pending steps that should be done for 2.11 and 2.12
Closing this ticket as we are moving to Jira to reduce noise. You can access it there.