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? #692

Open
wapco opened this issue Apr 5, 2024 · 0 comments
Open

Comments

@wapco
Copy link

wapco commented Apr 5, 2024

Hi,
I would like to know which fields have been changed after mapping entities using [Mapster], in order to facilitate the creation of audit logs in the future. Does Mapster 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant