This question is locked. New answers and comments are not allowed.
Hi,
Just wondering how is it possible to do lazy loading and change tracking without using reflection. How OA technically achieves this.
Another questions is if following tests will pass in OA:
Additionally how OA will behave in this scenario:
Thanks,
Dmitriy.
Just wondering how is it possible to do lazy loading and change tracking without using reflection. How OA technically achieves this.
Another questions is if following tests will pass in OA:
public void AddingPostAssignsBlog() { |
Blog b = new Blog(); |
Post p1 = new Post(); |
Post p2 = new Post(); |
b.Posts.Add(p1); // Not this: b.AddPost(p1) |
b.Posts.Add(p2); |
Assert.AreSame(b, p1.Blog); |
Assert.AreSame(b, p2.Blog); |
} |
public void AddingBlogAssignsPost() { |
Blog b = new Blog(); |
Post p1 = new Post(); |
Post p2 = new Post(); |
p1.Blog = b; |
p2.Blog = b; |
Assert.AreEqual(2, b.Posts.Count); |
} |
Additionally how OA will behave in this scenario:
Blog b1 = new Blog(); |
Blog p2 = new Blog(); |
Post p = new Post(); |
p.Blog = b1; // p is in b1 |
b2.Posts.Add(b); // b is in b2!! |
Thanks,
Dmitriy.