DapperLib / DapperAOT

Build time tools in the flavor of Dapper
Other
357 stars 19 forks source link

feature: non-trivial instance construction #30

Closed DeagleGross closed 1 year ago

DeagleGross commented 1 year ago

Closes #28

DeagleGross commented 1 year ago

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