Hi,
try using .AddEntity instead:
myEntityManager.AddEntity(myEntity);
The API documentation states:
The associated EntityManager will either be the EntityManager that was called to create this Entity (M:IdeaBlade.EntityModel.EntityManager.CreateEntity``1) or that was used to generate its ids ( ms-its:C:%5CProgram%20Files%20%28x86%29%5CDevForce%202010%5CDocumentation%5CIdeaBladeDevForce2010HelpReference.chm::/topic2880.html - IdeaBlade.EntityModel.EntityManager.GenerateId ) If neither of these cases apply, then the ms-its:C:%5CProgram%20Files%20%28x86%29%5CDevForce%202010%5CDocumentation%5CIdeaBladeDevForce2010HelpReference.chm::/topic2829.html - EntityManager 's DefaultManager"/> will be used. There is no difference between AddToManager and M:IdeaBlade.EntityModel.EntityManager.AddEntity(IdeaBlade.EntityModel.Entity). Use either method to add a business object created by the ms-its:C:%5CProgram%20Files%20%28x86%29%5CDevForce%202010%5CDocumentation%5CIdeaBladeDevForce2010HelpReference.chm::/topic2857.html - IdeaBlade.EntityModel.EntityManager.CreateEntity method to the EntityManager cache. The object must have a "detached" ms-its:C:%5CProgram%20Files%20%28x86%29%5CDevForce%202010%5CDocumentation%5CIdeaBladeDevForce2010HelpReference.chm::/topic2607.html - IdeaBlade.EntityModel.EntityAspect.EntityState , must not have ever been associated with another EntityManager and must have a unique EntityKey within the EntityManager to which it will be added.
I hope it helps,
Silvio.
|