Closed imtrobin closed 4 years ago
Hi @imtrobin, Can you show YYY and XXX classes' definitions?
public class XXX
{
public string Name = null;
public string Description = null;
public HashSet <string> Hashes = null;
}
public class YYY
{
public string ID = null;
public string Name = null;
public string Description = null;
public HashSet <string> Hashes = null;
public DateTime TimeCreated = DateTime.MinValue;
}
Currently, MappingGenerator is using properties to determine the source and destination of mapping. Is there any particular reason why you prefer fields over properties?
I see. I do not need c# properties get/set so I chose with simple fields since it is always public get/set
Since C# 3.0, when auto-implemented properties had been introduced, they should be a default choice.
I can't see any specific reason why this language relict should be supported - of course, PR with the implementation of this functionality is welcome.
These are just simple classes to map rest requests. I do use properties in other places, where needed. Will add it to my todo list. I presume you are using reflection so it should fairly easy to get member vars.
MappingGenerator is not using reflection. It's completely based on the Roslyn and SyntaxTree analysis.
Oh bummer, not familiar with that.
I'm working on it but I can't promise when this will be released (I need to refactor a couple of things before to keep the codebase still maintainable).
A new version 1.16.393 with this feature has been released. @imtrobin could you test it and let me know if this works as expected?
Hi cezary, seems to be working well, thanks!
Hi, is there some requirements of the map to work? I tried on my class, the "Generate mapping" part just shows new Class () without mapping the members. E.g.