I ran into an error I was not expecting and though I can prevent it I thought maybe it at least shouldn't blow up with this error...
I have an entity ContactBa that has a relationship with Contact which has a relationship with Department. When I create a new ContactBa it of course has no Contact which of course has no Department, but if the UI is bound to ContactBa.Contact.Department.Name...I get a collection modified error thrown. I presume its trying to "get" (lazily?) the Contact and Department but of course there is nothing if I justed create the ContactBa entity on the client. Turning off lazy loading did not prevent the error so...maybe its something else. If I remove the UI binding I do not get the error when I add a new ContactBa.
Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List`1.Enumerator.MoveNextRare() at System.Collections.Generic.List`1.Enumerator.MoveNext() at System.Linq.Enumerable.WhereListIterator`1.MoveNext() at IdeaBlade.Core.EnumerableFns.ForEach[T](IEnumerable`1 items, Action`1 action) at IdeaBlade.EntityModel.PendingEntityMap.Update(EntityWrapper pendingWrapper, EntityWrapper realWrapper) at IdeaBlade.EntityModel.ScalarEntityReference`1.InformPendingEntityOfRealEntity(EntityWrapper realEntity) at IdeaBlade.EntityModel.ScalarEntityReference`1.QueryCallback(EntityQueryOperation op) at IdeaBlade.EntityModel.BaseOperation`2.OnCompleted() at IdeaBlade.EntityModel.BaseOperation`2.IdeaBlade.EntityModel.IHasAsyncEventArgs.OnCompleted() at IdeaBlade.EntityModel.AsyncProcessor`1.<>c__DisplayClass2.<.ctor>b__0(TArgs args) at IdeaBlade.EntityModel.AsyncProcessor`1.Signal() at IdeaBlade.EntityModel.AsyncProcessor`1.<Execute>b__5(Object x) |
Edited by midnit - 07-Jul-2011 at 6:41am