This is a migrated thread and some comments may be shown as answers.

InvalidOperation when saving

2 Answers 46 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Greg
Top achievements
Rank 1
Greg asked on 10 Jan 2013, 04:59 AM
When adding an inumerable object to the context using context.Add(IEnumerable<T>) I get an InvalidOperation with the message: 8 instances failed to persist. I am not sure what is causing the error since I can ensure that the object is not managed by another context and that I saved a normal object (not of IEnumerable<T>) one line before the statement. Am I missing something here, because I can't tell from the given message. Any help would be great.

2 Answers, 1 is accepted

Sort by
0
Greg
Top achievements
Rank 1
answered on 10 Jan 2013, 05:03 AM
It seems like there was an issue with a single object in the list which caused a DuplicateKeyException. Is there no way to enable a "save by id" feature?
0
Damyan Bogoev
Telerik team
answered on 11 Jan 2013, 07:34 AM
Hi Greg,

Could you please provide us with additional information regarding the wrong behavior you are facing? What kind of identity mechanism is being used for these entities? It looks like custom values are being provided as primary key, but not database / client-side generated ones. A sample application which demonstrates the error will be highly appreciated.

We are looking forward to hearing from you.


Kind regards,
Damyan Bogoev
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Tags
Development (API, general questions)
Asked by
Greg
Top achievements
Rank 1
Answers by
Greg
Top achievements
Rank 1
Damyan Bogoev
Telerik team
Share this question
or