Hi there
The following test fails at the last line - it appears that LLBLGen does not fire the PropertyChanged event if it updates an entity ID after a save/refetch. The entity runs agains Firebird, the ID is generated by a generator which is invoked by LLBLGen. Is this supposed to work like this and if yes: What's the best pattern to conveniently get this change as well for auditing purposes?
//[Test]
public void TestPropertyEvents()
{
//init group
GroupEntity group = new GroupEntity();
group.QualifiedName = "hello world";
Assert.AreEqual(0, group.GroupId);
//register event listener and count events
int eventCount = 0;
group.PropertyChanged += delegate { eventCount++; };
using (DataAccessAdapter adapter = TestUtil.CreateAdapter())
{
Assert.IsTrue(adapter.SaveEntity(group, true));
}
//group ID changed?
Assert.AreNotEqual(0, group.GroupId);
//event fired?
Assert.AreEqual(1, eventCount, "ALWAYS FAILS - COUNTER IS 0);
}
btw: I noticed that I NEED to set at least one property (the _QualifiedName _in the test above). If I just try to save an empty (default) entity, LLBL does nothing at all, but _SaveEntity _still returns true. Took me quite a while to figure out what was happening. I'm aware that this is somewhat artificial, but just wanted to let you know...