Skip to content

Conversation

@DeagleGross
Copy link
Collaborator

Closes #28

@DeagleGross DeagleGross requested a review from mgravell August 12, 2023 14:41
@DeagleGross DeagleGross self-assigned this Aug 12, 2023
Copy link
Member

@mgravell mgravell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good; tiny nit on the spacing - petty but worth fixing; I suggest we merge after that, but a possible follow-up / extension (separate PR) would be to maybe take the same idea but generalized to include factory methods, i.e. [DapperAot] public static Foo Create(int id, DateTime when, string whatever) - very similar rules, but different nuances - for example, we can't support init-only members after a factory, but we can still support settable props, i.e.

var obj = Foo.Create(value0, value2, value1);
obj.Blah = value4;

thoughts?

@DeagleGross
Copy link
Collaborator Author

looking good; tiny nit on the spacing - petty but worth fixing; I suggest we merge after that, but a possible follow-up / extension (separate PR) would be to maybe take the same idea but generalized to include factory methods, i.e. [DapperAot] public static Foo Create(int id, DateTime when, string whatever) - very similar rules, but different nuances - for example, we can't support init-only members after a factory, but we can still support settable props, i.e.

var obj = Foo.Create(value0, value2, value1);
obj.Blah = value4;

thoughts?

sure, created an issue for follow-up: #34

@mgravell mgravell merged commit edbb5a2 into DapperLib:main Aug 19, 2023
@DeagleGross DeagleGross deleted the dmkorolev/custom-type-construction branch November 12, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-trivial construction

2 participants