I don't understand this warning: BL Mapping (Mapperly)

The member User on the mapping target type RestauraceNET8.Data.EF.DAL.Entities.Restaurace.RestauraceAkceStolu was not found on the mapping source type RestauraceNET8.Data.EF.BL.DTO.RestauraceDTO.Akce.RestauraceAkceStoluCreateDto It's my first time trying out Mapperly I don't understand why it can't find the Id of the target
5 Replies
Angius
Angius2w ago
Means the object you map to has property named User, while the object you map from does not So Mapperly doesn't know how to map that property
spit on that Thang CHO BOC
Pastebin
C# - Pastebin.com
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.
spit on that Thang CHO BOC
but its a NAV property though? hmmm So i just ignore it?
[MapperIgnoreTarget(nameof(RestauraceAkceStolu.User))]
[MapperIgnoreTarget(nameof(RestauraceAkceStolu.Header))]

[MapperIgnoreSource(nameof(RestauraceAkceStolu.User))]
[MapperIgnoreSource(nameof(RestauraceAkceStolu.Header))]
[MapperIgnoreTarget(nameof(RestauraceAkceStolu.User))]
[MapperIgnoreTarget(nameof(RestauraceAkceStolu.Header))]

[MapperIgnoreSource(nameof(RestauraceAkceStolu.User))]
[MapperIgnoreSource(nameof(RestauraceAkceStolu.Header))]
Angius
Angius2w ago
I guess so, yeah
spit on that Thang CHO BOC
Also One more question regarding DTO mapping do you think using CreateDTO inside another CreateDTO is better than using directly from Entity? Entity attribute
// FK
public required ICollection<RestauraceAkceStolu> RestauraceAkceStolu { get; set; } = [];
// FK
public required ICollection<RestauraceAkceStolu> RestauraceAkceStolu { get; set; } = [];
or what I have currently?
public List<RestauraceAkceStoluCreateDto> AkceStolu { get; set; } = [];
public List<RestauraceAkceStoluCreateDto> AkceStolu { get; set; } = [];

Did you find this page helpful?