Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I obtain the changed field values after mapping two entities? #1213

Closed
wapco opened this issue Apr 5, 2024 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@wapco
Copy link

wapco commented Apr 5, 2024

Hi,
I would like to know which fields have been changed after mapping entities using Mapperly, in order to facilitate the creation of audit logs in the future. Does Mapperly currently support this feature or will it support it in the future?

Eq:

var car = new Car
{
    Name = "my car",
    NumberOfSeats = 5,
    Color = CarColor.Blue,
    Manufacturer = new Manufacturer(1, "best manufacturer"),
};

var carDto = new CarDto
{
    Name = "your car",
    NumberOfSeats = 6,
    Color = CarColor.Black,
    Manufacturer = new Manufacturer(1, "best manufacturer"),
};`

audit log like this: 
Name: my car -> your car,
NumberOfSeats: 5 -> 6
Color: CarColor.Blue -> CarColor.Black
@wapco wapco added the enhancement New feature or request label Apr 5, 2024
@latonz
Copy link
Contributor

latonz commented Apr 5, 2024

This is not supported and seems to be out of scope for an object mapper.

@latonz latonz closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants