-
Notifications
You must be signed in to change notification settings - Fork 921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set DefaultEncodingId in DataTypeDefinition, was always null NodeId #1523
Conversation
mregen
commented
Sep 23, 2021
- DefaultEncodingId is always set to binary encoding id
- the default encoding id is derived for the encodeable factory, since the typetree does not contain sufficent information to find the proper binary encoding id
- add a few helper functions in core for an upcoming PR that was used for testing with custom types, will simplify to add more nodemanagers to servers with custom types
@@ -75,6 +72,12 @@ public interface IEncodeableFactory | |||
/// <param name="assembly">The assembly containing the types to add to the factory</param> | |||
void AddEncodeableTypes(Assembly assembly); | |||
|
|||
/// <summary> | |||
/// Adds an enumerable of extension types to the factory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enumeration
Codecov Report
@@ Coverage Diff @@
## master #1523 +/- ##
==========================================
+ Coverage 52.96% 53.01% +0.05%
==========================================
Files 307 307
Lines 58376 58387 +11
==========================================
+ Hits 30919 30956 +37
+ Misses 27457 27431 -26
Continue to review full report at Codecov.
|
This pull request introduces 2 alerts when merging 9e6454c into 0d34b7d - view on LGTM.com new alerts:
|
if (ServiceResult.IsGood(result)) | ||
{ | ||
if (dataTypeDefinition?.Body is StructureDefinition structureType && | ||
structureType.DefaultEncodingId.IsNullNodeId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this piece of code covering enum datatypes as well? or they don't need special handling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, EnumDefinition does not have a DefaultEncodingId as a member, I wonder why it is only needed for struct... I believe enum are encoded as int anyway, so it may not even matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
sorry, I found a better way to add the setter code to the StructureDefinition, so it could be used for other means like metadataframe |
This pull request introduces 3 alerts when merging 2ed6867 into 0d34b7d - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 857bf74 into 0d34b7d - view on LGTM.com new alerts:
|