TodoList icon indicating copy to clipboard operation
TodoList copied to clipboard

[Suggestion] Use AutoMapper for object-object mapping

Open jenia90 opened this issue 4 years ago • 6 comments

Currently we use manual mapping of DTOs to their respective DB entities which clutters the code.

Proposed solution It would be nice to use AutoMapper library for automatic mapping of objects.

Alternative solution An alternative solution, in case we don't want to add more packages, would be to implement Map() extension methods for every objects.

jenia90 avatar Oct 18 '19 15:10 jenia90

I like this, but first, wait for @ncindric to close his PR #46. I don't want him to fight with conflicts.

Blocked by #42.

amoraitis avatar Oct 19 '19 09:10 amoraitis

@amoraitis sure, in the mean time I'll look into what is needed for implementing it in your project. If you don't want to take it yourself, I'd like to be assigned to it :)

jenia90 avatar Oct 19 '19 09:10 jenia90

@jenia90 I would like to work on this, too. But, it's your issue, it's up to you.

What I would do: I would open an AutoMapper branch here and we could contribute to that branch together.

What do you think?

amoraitis avatar Oct 19 '19 09:10 amoraitis

@amoraitis Sounds like a good idea!

jenia90 avatar Oct 19 '19 09:10 jenia90

@jenia90 here: https://github.com/amoraitis/TodoList/tree/feature/45-automapper

amoraitis avatar Oct 23 '19 18:10 amoraitis

@amoraitis Awesome! But how do we split the work so we don't interfere each other?

jenia90 avatar Oct 23 '19 19:10 jenia90