Open danielreganuk opened 2 years ago
Are there plans to have true 'AutoMapping' for properties that are identical for both source and destination?
For example:
class Person { firstName: string; lastName: string; dateOfBirth: string; } class SourcePerson { fullName: string; dateOfBirth: string; } AutoMapper.create<Person, SourcePerson>('PersonToSourcePerson') .map( (input) => input.firstName + ' ' + input.lastName, (output) => output.fullName ) const sourceObject: Person = { firstName: 'John', lastName: 'Smith', dateOfBirth: '01/01/1990', }; const mappedResult = AutoMapper.exec<Person, SourcePerson>('PersonToSourcePerson', sourceObject);
In this case, I would expect my result to show:
{ fullName: John Smith, dateOfBirth: 01/01/1990 }
Instead it is:
{ fullName: John Smith }
I can't see this in the todos but from using AutoMapper with .net for many years, it was just an expected result.
Thanks, Dan
Hi @danielreganuk, Thanks for your interest on this project!
That makes sense! I'll add this feature ASAP.
Are there plans to have true 'AutoMapping' for properties that are identical for both source and destination?
For example:
In this case, I would expect my result to show:
Instead it is:
I can't see this in the todos but from using AutoMapper with .net for many years, it was just an expected result.
Thanks, Dan