cezarypiatek / MappingGenerator

:arrows_counterclockwise: "AutoMapper" like, Roslyn based, code fix provider that allows to generate mapping code in design time.
https://marketplace.visualstudio.com/items?itemName=54748ff9-45fc-43c2-8ec5-cf7912bc3b84.mappinggenerator
MIT License
1.03k stars 120 forks source link

Mix constructor arguments and object initializer with parameter object #64

Closed lindeberg closed 5 years ago

lindeberg commented 5 years ago

Hello! In this image there are lots of more identical properties to map from command to the new CourseParticipant - only some goes via constructor and it works well. Then I want to object initialize the rest but it won't work.

image

cezarypiatek commented 5 years ago

Hi

The object initializer should handle all properties with public setter or should ignore properties that fit to source properties matched to constructor parameters?

lindeberg commented 5 years ago

I think the latter.

cezarypiatek commented 5 years ago

Tracking what has been already used for mapping is the hardest part, but I will give a try.

cezarypiatek commented 5 years ago

@lindeberg Here's a version with fixed issue. Would you mind to test it and tell me if everything is working as expected? https://ci.appveyor.com/api/buildjobs/po8qd7ghrmfg46fw/artifacts/MappingGenerator%2FMappingGenerator%2FMappingGenerator.Vsix%2Fbin%2FRelease%2FMappingGenerator.vsix

lindeberg commented 5 years ago

@cezarypiatek Yes!! It works!! Wow, fast action. Thank you so much.

cezarypiatek commented 5 years ago

Thanks for testing. I really appreciate it.