AutoMapper/AutoMapper — Issue #165: Mapping an EntityObject to POCO and back in WCF RIA services causes duplicate child entities
Author: icnocop
Created: 2011-12-29 09:56:42+00:00
State: open

Hi.

I created a complete Visual Studio 2010 solution that can reproduce the issue here:

http://dl.dropbox.com/u/42317133/WcfRiaAutoMapper.zip

1. Build the solution.
2. Run the unit test in the test project to deploy the database.
3. Debug the SilverlightApplication1 project
4. Click on the "Click me" button.
5. Notice that two Authors are added to the Authors database table when only one was expected.

The problem exists during the mapping in the InsertPost method in BlogService.cs in the "RIAServicesLibrary1.Web" project.

If I comment those two lines out, then it works as expected.

Any ideas?

This happens with both AutoMapper 1.1 and AutoMapper 2.0.0

Thank you very much.