Trying to delete a single child entity from a n:m relationship, result of adapter.DeleteEntity() is true, correct SQL is generated but the entity still sticks around. Any ideas on why this should be ?
DataAccessAdapter adapter = new DataAccessAdapter();
// bookinglock_id is PK, identity column, previously persisted entity
BookingLockEntity bookinglock = new BookingLockEntity( bookinglock_id );
adapter.FetchEntity( bookinglock );
adapter.StartTransaction( IsolationLevel.ReadCommitted, "Unlock Booking");
try
{
bool IsDeleted = adapter.DeleteEntity( bookinglock );
adapter.CloseConnection();
}
catch
{
adapter.Rollback();
throw;
}
adapter.CloseConnection();
Generated Sql query:
Query: DELETE FROM [dbname].[dbo].[BookingLock] WHERE ( [dbname].[dbo].[BookingLock].[BookingLock_ID] = @BookingLock_ID1)
Parameter: @BookingLock_ID1 : Int16. Length: 0. Precision: 5. Scale: 0. Direction: Input. Value: 18.
Method Exit: CreateSingleTargetDeleteDQ(3)
Method Exit: CreateDeleteDQ(4)