-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Default values are not applied #142
Comments
But if I add |
I believe this is due to this snippet not actually "copying over" the default value assignments to the builder's properties: RecordGenerator/src/Amadevus.RecordGenerator.Generators/BuilderPartialGenerator.cs Lines 33 to 48 in f1fca2d
Then once you add |
Hi, yes you're correct - default values aren't copied over to the Builder. Since the record's constructor actually requires passing all of the properties into it, it wouldn't ever be used anyway. It could be indeed if "copied over" into Builder - but it introduced a lot of other headaches (e.g. default value being a class constant/static field would fail to resolve correctly inside Builder). I won't be developing this project since C#9 provides If you'd provide a PR with unit tests, it's possible I'd accept and release it however, because it doesn't seem to be a big change. |
Hi, first of all thank you for this library. It's awesome.
Found out that if I try to set default value to property when there is only getter, then it's not set up.
So here
IsCenter
will benull
But if I make it like this
Then it will be
true
.The text was updated successfully, but these errors were encountered: