I want to update an existing entity object from another model. But each time I got a new object (Having the mapped properties and default values for other properties.) Instead, I want a partially updated destination object.
AutoMapper.Mapper.Initialize(cfg => cfg.CreateMap<Customer, MYPOCO>().ReverseMap());
public void UpdateEntity(Customer customerSrc)
{
MYPOCO pocoDesc= dbContext.DD_POCO.SingleOrDefault(m => m.Id == 123);
pocoDesc = AutoMapper.Mapper.Map<Customer, MYPOCO>(customerSrc, pocoDesc);
// Here "pocoDesc" is a new object, I got only "customerSrc" data and lost all other existing properties values.
}
Automapper: 6.2.2(version)
Tried Automapper: Update property values without creating a new object
Any Idea?