This issue is about the "de"referencing of an entity as recorded by the auditor. My other issue about Referencing still stands.
I'm using the this code:
[Test]
public void TestAuditOfDereferenceOfEntity()
{
// Make parent entity
TestTableParent entityParent1 = new TestTableParent();
TestTableParent entityParent2 = new TestTableParent();
entityParent1.Data = "TestParent1";
entityParent2.Data = "TestParent2";
// Save parent entities so that we have an ID
_adapter.SaveEntity(entityParent1, true);
_adapter.SaveEntity(entityParent2, true);
// Make sure they got saved
Assert.Greater(entityParent1.Id, 0);
Assert.Greater(entityParent2.Id, 0);
// Make child entity
TestTableChild entityChild = new TestTableChild();
entityChild.Data = "TestChild";
// Now lets reference the child to parent1
//entityParent1.TestTableChild.Add(entityChild);
entityChild.TestTableParent = entityParent1;
// Save child enitty
_adapter.SaveEntity(entityChild, true);
Assert.Greater(entityChild.Id, 0);
// THE TEST: Now let's change the reference from parent1 to parent2
//entityChild.TestTableParent = entityParent2;
//_adapter.SaveEntity(entityChild);
}
Ok.
Notice the last two lines above (commented out). I set up the AuditInfo table just like the sample provided in the download section.
This gives the following set of records in this order. The numbers are the enum values also the same as the example (8 = Insert new entity, 5 = Reference of entity)
TestTableParentEntity 8
TestTableParentEntity 8
TestTableChildEntity 5
TestTableChildEntity 8
This so far makes sense. Now when I "UN"comment the last two lines and re-run I get this
TestTableParentEntity 8
TestTableParentEntity 8
TestTableChildEntity 5
TestTableChildEntity 8
TestTableChildEntity 4
TestTableChildEntity 4
TestTableChildEntity 5
This would make sense if there was only ONE dereference record but there are two.
Any thoughts?
-Luke