Skip to content
Discussion options

You must be logged in to vote

I don't think it's going to be in 9.0, but the idea that the LDT wants to do is allowing to annotate the factory method with an attribute (eg. [Factory]) which the compiler recognizes and will limit what you can actually return (only new and the return value of other [Factory] methods), and that will let you add an object initializer at the callsite. More information here (the example is on With(), but that's just a special case of the more general feature).

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by msedi
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants