Possibility of Existing a version of this library using .NET 5 Code Generator in the future?
victorperez2911 opened this issue · 2 comments
Hi @joelweiss
I don't know if I'm thinking correctly, but I imagine that using the "Code Generator" feature of .NET 5, the properties of the POCO Classes would not need to be marked as Virtual in order to be trackble.
What do you think ?
I don't think it can work, "Code Generator" can only add code not modify existing code.
Can I modify/rewrite existing code with a Source Generator?
No. As mentioned earlier, Source Generators do not allow you to rewrite user source code. We do not intend on allowing them to this. They can only augment a compilation by adding C# source files to it.
I don't think it can work, "Code Generator" can only add code not modify existing code.
Can I modify/rewrite existing code with a Source Generator?
No. As mentioned earlier, Source Generators do not allow you to rewrite user source code. We do not intend on allowing them to this. They can only augment a compilation by adding C# source files to it.
Yes, the written code cannot be edited.
However, perhaps, with the requirement that the DTO class be written with "Partial", make the library only write code in another "file" of the class.
There are examples of Implementation of the INotifyPropertyChanged standard using this approach.
Just an idea.