Mapster icon indicating copy to clipboard operation
Mapster copied to clipboard

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

Open wapco opened this issue 1 year ago • 0 comments

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

wapco avatar Apr 05 '24 10:04 wapco