Closed ewoutkramer closed 1 month ago
error CP0002: Member 'Hl7.Fhir.Model.Parameters.ParameterComponent Hl7.Fhir.Model.Parameters.this[string].get' exists on [Baseline] lib/net8.0/Hl7.Fhir.Base.dll but not on lib/net8.0/Hl7.Fhir.Base.dll [D:\a\1\s\src\Hl7.Fhir.Base\Hl7.Fhir.Base.csproj]
Use GetSingle()
instead.
error CP0002: Member 'bool Hl7.Fhir.Utility.ReflectionHelper.IsTypedCollection(System.Type)' exists on [Baseline] lib/net8.0/Hl7.Fhir.Base.dll but not on lib/net8.0/Hl7.Fhir.Base.dll [D:\a\1\s\src\Hl7.Fhir.Base\Hl7.Fhir.Base.csproj]
Use IsListCollection()
. instead
There are too many things I want to comment on to do this via PR comments. Not because it's bad, but because I have not worked on this so I do not know what complications impacted your design :) We should discuss in person or over slack.
Description
This PR is the first shot at adding support for overflow to POCOs. It should not introduce major breaking changes.
Remarks
⚠️ I had introduced the
this[]
operator for setting values, as we already had a getter for it hidden behindIReadOnlyDictionary
. This meant that an existingthis[]
operator on theParameter
resource had to be removed as it conflicted with this operator inBase
. Later I implemented this operator explicitly, so the problem does not exist anymore, but just for future flexibility I am removing this minor feature. This is a breaking change.⚠️ Since pocos now implement IDictionary, they implement ICollection, which triggered bugs since we used a comparison to
ICollection<T>
to detect whether an element repeated or not. I changed the method in ReflectionHelper to detectIList<>
instead. This is a breaking change.⚠️ Also review and pull https://github.com/FirelyTeam/fhir-codegen/pull/42, which are the changes to the codegen necessary to produce POCO's for this PR.
Related issues
Fixes #2901.