1

I saw this Post by ADO.Net team which looks very promising until I started using it in my application. I have EF 4.0 model with close to 100 self tracking entities. After including the iterator in my project, any of the extension methods "StartTrackingAll" or "StopTrackingAll" would take 5sec to finish. Has anyone ran into same issue or anyone knows of any better option.

mahichR
  • 355
  • 3
  • 14

1 Answers1

1

Are your entities in relation? In that case you don't need to use StartTrackingAll because StartTracking itself starts tracking for whole object graph:

The StartTracking method instructs the change tracker on the entity to start recording any changes applied to the entity. This includes changes to scalar properties, collections, and references to other entities. The self-tracking entities start tracking automatically when they are deserialized into the client through the Windows Communication Foundation (WCF). The tracking is also turned on for newly created entities in the following scenarios:

* A relationship is created between the new entity and an entity that is already tracking changes.

* The MarkAs[State] or AcceptChanges method is called on an entity.

If you are not using related entities it sounds strange that you need to track 100 entities in the same time. Also if entities don't have relations it is perhaps not needed to track them at all.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670