I have an AR class (lets call A) with a HasMany relationship where
Fetch is set to FetchEnum.SubSelect (called RelB).
I have a test which opens up a SessionScope, creates a number of A's,
then does a FindAll() for the class. The returned objects have their
RelB set to null.
If I close the session, then call the FindAll, RelB has the expected
list.
In code:
[ActiveRecord]
public class A : ActiveRecordBase<A> {
...
[HasMany(Fetch=FetchEnum.SubSelect)]
public IList<B> RelB { get; set; }
}
void test() {
using(new SessionScope()) {
<-- Create some A's with links to B's -->
var test = A.FindAll();
Assert.IsTrue(test[0].RelB == null);
}
var test2 = A.FindAll();
Assert.IsTrue(test2[0].RelB != null);
}
Am I missing something fundamental here, or is this a bug?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.