Hi!
I'm using LLBL 2.5 on SQL Server 2005.
Upon accessing a property, not accessed before, that holds a related entity, SelfServicing code will try to fetch the proper related entity. If it fails, it creates a new entity and returns that. I'm ok with all this.
However, I've noticed that in a piece of code that goes something like this:
entityA.entityBviaId.foo = 1;
entityA.entityBviaId.bar = 2;
the fetch gets performed every time I access the entity, which I can confirm in the trace output. In this particular case it would be performed twice. Also, when I save ( by entityA.Save(true) ) the entityB gets only the last field, "bar", set.
Apparently, each time I access the lazy-loaded entity, the code tries to fetch it, fails (which is ok, there is no such entity in the DB), and each time creates and returns a brand new entity.
If it's of importance, the relation in question is 1:1.