Print Page | Close Window

Is there a way to get delete an entity and get reference of that entity and pass to SaveChanges?

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=231
Printed Date: 11-Apr-2026 at 9:33pm


Topic: Is there a way to get delete an entity and get reference of that entity and pass to SaveChanges?
Posted By: Customer
Subject: Is there a way to get delete an entity and get reference of that entity and pass to SaveChanges?
Date Posted: 12-Jul-2007 at 4:50pm

I have a question for you with regards deleting entities. In the older version we used to call the delete on an entity but we could still retain the reference of that entity which we pass to PersistanceManager.SaveChanges(IList pDatarows….)

With the new DevForce (generics), the Entity is getting deleted from the EntityList<T> after a Delete() is called on the Entity. And so, the reference is lost and the only option we have is to call PersistanceManager.SaveChanges() [without passing any entity itself].

Is there a way to delete an entity and get a reference to that entity and pass it to SaveChanges of PersistenceManager to exclusively call savechanges on those specific entity list? 

I appreciate your response on this.




Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 4:57pm

There is a property on EntityList named ShouldRemoveDeletedEntities that should do what you want.




Print Page | Close Window