New Posts New Posts RSS Feed: Entity not getting Deleted
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Entity not getting Deleted

 Post Reply Post Reply
Author
Inder_gujral View Drop Down
Newbie
Newbie


Joined: 12-Jun-2011
Posts: 6
Post Options Post Options   Quote Inder_gujral Quote  Post ReplyReply Direct Link To This Post Topic: Entity not getting Deleted
    Posted: 12-Jun-2011 at 8:16am
Hi,

I am using IdeaBlade version 6.0.8.1 Entity Model Extension Dlls. How to delete an entity?

If I use Context.RemoveEntity(entity) and do a SaveChangeAsync(). The data still stays in the database.

I checked the samples provided for delete and update. There you are using entity.DeleteGraph() method which is available for each entity.

But in version 6.0.8.1, the deletegraph method is not available. Can you please tell how to delete the entity?

I am not facing any error. Its just the operation executes but data still stays in db.

Looking forward to your quick response.

Thanks
Inder Gujral
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 13-Jun-2011 at 1:51pm
When you remove the entity, you are just detaching it, which of course would not result it in being deleted from the datasource. What you want to do is mark it for deletion with Delete(), and then SaveChanges().
 
 
Some of our newer examples do show this in effect. For example, if you look at the Tour of Silverlight example, you'll find these methods in the view model:
 
 

private void Delete(IEnumerable<Employee> employees) {

employees.ForEach(employee => employee.EntityAspect.Delete());

Save();

}

 
Sorry if the samples you have are out of date. You may want to download new versions from the DRC.
 
Yours,
Robert
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down