Print Page | Close Window

Is there an event on our Entity class that can tell you when a Entity has been added or removed?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=213
Printed Date: 06-May-2024 at 12:37am


Topic: Is there an event on our Entity class that can tell you when a Entity has been added or removed?
Posted By: Customer
Subject: Is there an event on our Entity class that can tell you when a Entity has been added or removed?
Date Posted: 12-Jul-2007 at 3:49pm

Is there an event on our Entity class that can tell you when a Entity has been added or removed from the DataSet?  For example, I want to be notified in my app whenever an entity arrives into or is removed from my persistence manager via the following paths: 

  • I execute an RdbQuery and retrieve an entity into my dataset from the database.
  • I create a new entity and add it to the manager via the AddToManager method.
  • I import an entity from another persistence manager via the ImportEntities method.
  • I detach an Entity and it is removed from the persistence manager.
  • I re fetch an Entity and it no longer exists in the database and it is removed from my manager.



Replies:
Posted By: Customer
Date Posted: 12-Jul-2007 at 3:51pm

The PersistenceManager does not fire events during CreateEntity() or Delete(). However there are events raised by the underlying DataTable class that you can register for, namely TableNewRow and RowDeleting. You always have access to the underlying DataTable via PersistenceManager.GetTable().

Is there such an event that is called that I can register with on the Entity itself?




Print Page | Close Window