A specification pattern can be used to compose objects as shown in the example below:
IUser user =
UserSpecification
.ForPerson()
.WithName("myname")
.WithSurname("mysurname")
.WithPrimaryContact(ContactSpecification.ForEmailAddress("abc@email.com"))
.AndNoMoreContacts()
.Build();
This leads to manually map the data from DTO to the specification object. Is there a way, we can use automapper to fill object while using specification pattern? Does Automapper support this in any way?
Thanks