New Posts New Posts RSS Feed: ListManager delegate not detecting deletes
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

ListManager delegate not detecting deletes

 Post Reply Post Reply
Author
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Topic: ListManager delegate not detecting deletes
    Posted: 16-Feb-2009 at 3:26pm
Originally posted by mrivers

I've created a ListManager who's delegate always returns true when an entity being managed by the ListManager changes or is added. I would also like the delegate to catch any deletions of the managed entity type. Do I have to do something different to be able to detect the deletions?
 
Here is my code snippet:
........................................................
mEntityList = pManager.PersistenceManager.GetEntities<Property_Entity>(pQuery);
Predicate<Property_Entity> predicate =
delegate(Property_Entity pType)
{
return true;
};
 
mEntityList.ListManager = new EntityListManager<Property_Entity>(pManager.PersistenceManager,
predicate,
new EntityColumn[] { Property_Entity.PropertyidEntityColumn, Property_Entity.PresentvalueEntityColumn, Property_Entity.LiquidEntityColumn });
.............................................



Originally posted by mrivers


Do I have to do something different to be able to detect the deletions?


1. DevForce removes deleted entities from EntityLists as a matter of course: no EntityListManager required.  What contrary behavior are you seeing?

2. EntityListManagers can be expensive, performance-wise, if overused and/or defined inefficiently. The EntityListManager you've defined looks somewhat inefficient in that, since you've said *any* entity of the specified type belongs in the list (no exclusionary criteria in the predicate), I don't see what the point is of monitoring the Presentvalue and Liquid entity columns. The test on the PropertyidEntityColumn will already guarantee that any new instance of Property_Entity will get included in your list; and there's no change to either a Presentvalue or Liquid property that would cause an entity already in the list to be removed from it.

Back to Top
mrivers View Drop Down
Newbie
Newbie
Avatar

Joined: 28-Aug-2007
Location: Franklin, TN
Posts: 2
Post Options Post Options   Quote mrivers Quote  Post ReplyReply Direct Link To This Post Posted: 11-Feb-2009 at 12:54pm
I've created a ListManager who's delegate always returns true when an entity being managed by the ListManager changes or is added. I would also like the delegate to catch any deletions of the managed entity type. Do I have to do something different to be able to detect the deletions?
 
Here is my code snippet:
........................................................
mEntityList = pManager.PersistenceManager.GetEntities<Property_Entity>(pQuery);
Predicate<Property_Entity> predicate =
delegate(Property_Entity pType)
{
return true;
};
 
mEntityList.ListManager = new EntityListManager<Property_Entity>(pManager.PersistenceManager,
predicate,
new EntityColumn[] { Property_Entity.PropertyidEntityColumn, Property_Entity.PresentvalueEntityColumn, Property_Entity.LiquidEntityColumn });
.............................................
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down