New Posts New Posts RSS Feed: Using EntityServerSaveInterceptor with CF
  FAQ FAQ  Forum Search Search  Calendar Calendar  Register Register  Login Login

Using EntityServerSaveInterceptor with CF

 Post Reply Post Reply
Author
jradxl View Drop Down
Newbie
Newbie


Joined: 14-Jun-2011
Posts: 30
Post Options Post Options   Quote jradxl Quote  Post ReplyReply Direct Link To This Post Topic: Using EntityServerSaveInterceptor with CF
    Posted: 04-Sep-2012 at 4:17pm
When trying to use an EntityServerSaveInterceptor with Code First I'm getting a "Collection was modified; enumeration operation may not execute" error.

Is it obvious what I'm doing wrong?

thanks
        protected override bool ExecuteSave()
        {
            var em = this.EntityManager;
            var entities = em.FindEntities(EntityState.Added | EntityState.Modified | EntityState.Deleted);
            foreach (IEntity entity in entities)
            {

Back to Top
jradxl View Drop Down
Newbie
Newbie


Joined: 14-Jun-2011
Posts: 30
Post Options Post Options   Quote jradxl Quote  Post ReplyReply Direct Link To This Post Posted: 05-Sep-2012 at 3:43am
Sorry, it was late..
I was adding a new entity for auditing and was refactoring some code and forgot why I did it that way originally.
Now I just put them in a collection and addEntities() later outside loop.
Thanks


Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down