Is there a way that I can ignore all properties except for a few?
Example:
I only want Book.Title and Book.PublishedData to be mapped:
// Is this possible?
config.AdaptTo("[name]Dto")
.ForType<BookDomain>(cfg => {
cfg.Map(poco => poco.Title);
cfg.Map(poco => poco.PublishedDate);
});
// Expected ouput:
public class BookDomainDto
{
public string Title {get; set;}
public DateTime PublishedDate{get; set;}
}
I can write custom methods for this of course.. but I would prefer something that is built into the library.
Hello all,
I looked here and did not see the option for this, I also reviewed the Issues and don't think this has been asked before.
I saw this issue that was similar, but the issue was about Mapping, and not code generation: https://github.com/MapsterMapper/Mapster/issues/159
Goals:
Example:
I have a Domain Entity with many properties, such as below:
Is there a way that I can ignore all properties except for a few?
Example:
I only want
Book.Title
andBook.PublishedData
to be mapped:I can write custom methods for this of course.. but I would prefer something that is built into the library.
Thanks, I hope this makes sense.
Very cool library!