Open
Description
I've just found this project and decided to try it out by copying the example provided in the readme. On doing so I found some issues, although since I'm not familiar with the project it may be my fault.
- The
ClassBuilder.AddConstructor
method returns aConstructorBuilder
which doesn't contain anAddProperty
method.
This requires using theClass
property to go back to theClassBuilder
.
Alternatively, maybeConstructorBuilder
could add theAddProperty
method so the example just works. It seems other builders follow this pattern (e.g.:ClassBuilder.AddNamespaceImport
). - The
ClassConstructor.AddProperty
method doesn't have an overload that takes the type of the property.
This requires using thePropertyBuilder.SetType
method.
However, specifying the type of the property is required so I feel like it would be better to add a parameter1 to theAddProperty
method which would make the example work. - The generated output doesn't include the accessibility modifiers since they weren't specified.
I suggest adding the accessibility modifiers to the example or modifying the output in the readme to match the generated output. - The generated output always adds the namespace in the
SomeOtherType
parameter and property, but the output in the readme doesn't include it.
If this is intentional, I think the output in the readme should be modified to match the generated output. - The generated output declares the properties in reverse order, unlike what's being shown in the readme.
Should the property order be respected or is this intentional?
I'm willing to make a PR with the changes needed to fix this issue, let me know what would be the preferred way to resolve it.
Footnotes
-
It can be a new overload to preserve binary compatibility, not sure how important that is for this project. ↩
Metadata
Metadata
Assignees
Labels
No labels