InvalidOperation when saving

3 posts, 0 answers
  1. Greg
    Greg avatar
    2 posts
    Member since:
    Dec 2012

    Posted 09 Jan 2013 Link to this post

    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. Greg
    Greg avatar
    2 posts
    Member since:
    Dec 2012

    Posted 09 Jan 2013 Link to this post

    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?
  3. DevCraft banner
  4. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 11 Jan 2013 Link to this post

    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.
Back to Top