Using the model above, I am trying to save a new PamNewsMessage
and add Tags to it then save it to the DB. However, after trying many different combinations of adding objects and saving, I still have the same problem with duplicate entries (not duplicate keys).
Currently, this is what I am using to make the changes, and it works for the PamNewsMessage
, however if a Tag already exists, it makes a duplicates.
_theService = new WCFPamUpdateServiceEntities3();
_theService.PamNewsMessages.AddObject(pnm);
_theService.SaveChanges();
I am not sure what else I need to do here, it should be pretty straight forward. I have read a lot of people having similar problems with no clear fix that I have found. Can anybody help me out here I have messed around with this for many hours now reading and trying different combinations of ways to save things, changing states, and what not.
Thanks,
Richard
Sorry about not being able to post pictures, long time reader first time poster :-)
(fixed this for you - marc_s)