I have written a little program that deletes a record from the database using the RIA Data Services (Silverlight) and I am using a datagrid to view my entity.
private void DeleteButton_Click(object sender, RoutedEventArgs e)
{
DataContext _PersonService =
(DataContext)(personDataSource.DomainContext);
person removeThisPerson = (person)(dataGrid.SelectedItem);
// This removes it from the grid/entity
_PersonService.persons.Remove(removeThisPerson);
// This removes it from the database.
// After this it shows back up in the grid :(
personDataSource.SubmitChanges();
}
When I run the SubmitChanges() the record is removed from the grid but then reappears on the grid. It comes back to the grid with an "EntityState = New".
When I query the database, the record is gone. So, why is the entity not removing the record?
Where do the zombies come from?