You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Idea is to flatten the objects so they can be mapped to a property with a name matching their path, in this example we have "Order -> customer (User) -> email" that is flatten to "Order -> customerEmail"
The text was updated successfully, but these errors were encountered:
I think this can be done with transformer and expression language now ?
Like :
class Order
{
public string $reference;
#[MapTo(OrderDTO::class, name: 'customerEmail', transformer: 'source.customer.email')]
public User $customer;
}
Do we want to add more than that ? (I think it will be pretty complicated, so i would say no)
Inspired from https://docs.automapper.org/en/stable/Flattening.html
The idea is to makes simpler DTO compared to your source entities (or whatever your source is).
Let's do a quick example:
Idea is to flatten the objects so they can be mapped to a property with a name matching their path, in this example we have "Order -> customer (User) -> email" that is flatten to "Order -> customerEmail"
The text was updated successfully, but these errors were encountered: