Closed miniragnarok closed 1 year ago
For now, you can try to use the [TwinType]
attribute from my other package along with the corresponding code fix
More details in this article https://cezarypiatek.github.io/post/csharp-twin-types/
Agreed, this would be a great feature, being able to create an empty class, adding a constructor with the source class instance and then alt-enter -> create all the properties, mapped.
Hi @miniragnarok , @karlra
What are your expectations regarding mapping complex properties? Should the generated property have the same type or a new type should be generated for it?
Same type. Even if it just works for simple types it would still save a huge amount of typing.
I've started working on this feature. It will be fun ;)
Nice! I thought this feature existed in the plugin, it was why I bought it in the first place so thanks for that :)
I have a working POC. I will try to ship a basic implementation next week.
Hi @miniragnarok , @karlra
I've just released a new version 2023.1.51 with a basic implementation of the requested feature. Any feedback you can give me is welcome.
It's perfect except for one thing, could we get an option to generate properties above the constructor instead of below? :)
Currently, the properties are added at the end of the type definition. I can tweak it a little bit to match the conventions. Thanks for the feedback.
This should be fixed in v2023.1.52. Please let me know if it's working according to your expectations.
Works great! Thank you!
It would be a great feature if properties could be generated for a DTO from another class as a part of the complete mapping feature.