Mapperly Help how to map child CreateDto's?
I have a problem that I cannot solve at the moment
I still don't know how to map the properties of the child CreateDto's. Mapperly documentation I didn't find anything about it or just don't understand it. If someone can guide me or help me map this so I can do this to my other entities.
MapperProfile:
https://pastebin.com/nPFx5uEF
This is the DTO I am refering to:
https://pastebin.com/s48iuVfk
Entity:
https://pastebin.com/bcDuveLY
Pastebin
using RestauraceNET8.Data.EF.BL.DTO.RestauraceDTO.ObjednavkaPolozky...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
using RestauraceNET8.Data.EF.BL.DTO.RestauraceDTO.ObjednavkaPolozky...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
namespace RestauraceNET8.Data.EF.DAL.Entities.Restaurace;public cla...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
1 Reply
Mapperly allows custom mappers, which are not partial, so they are manually created.
First of all, you should create a partial mapper, and use
This way no mapping will be generated for the specified property. https://mapperly.riok.app/docs/configuration/mapper/#ignore-properties--fields
This partial mapper should be declared as private, since it will be used by the public one. What you are looking for is called after mapping. https://mapperly.riok.app/docs/configuration/before-after-map/
Exmaple
Before / after map | Mapperly
Run custom logic before or after the generated mapping.
Mapper configuration | Mapperly
Define a mapper with Mapperly.