Regarding EF4, I have an IQueryable<int> subquery and wrote a Func<T, bool> predicate = o => subquery.Contains(o.SomeId) that I use to call IObjectSet<T>.Where(predicate) ... does anyone know offhand if subquery will be evaluated more than once?
It's no problem; our discussion has made me think that mapping the function table is probably the best approach after all, since EF will keep track of changes for me
Yes, I see. But if I've made a large batch of changes to the relationship property, how would I find them all without manually keeping track of all changes?
So if I do something like student.Course.Add(course1), both course1 and student will have their EntityState == EntityState.Unchanged ... the question is how to find the newly added relationship, so I can revert it?
@LINQ2Vodka I've already accomplished that in my application. My problem is how to search for relationships that have been added or deleted (before committing to the database with the SaveChanges() method), and reverting those changes.
Going with your example, if I add a new course to student.Courses, neither the student nor the course has been modified -- just the relationship, which I have no means of identifying ... that said, I'm starting to think I should just map the table.
I'm not sure how that would help. My problem is that because the junction table isn't mapped to a type in my model (and I don't really want to map it), I have no means of checking EntityState to find changes that haven't been saved, or calling ObjectContext.Refresh() to revert those changes
Does anyone happen to know how to refresh (from store) changes to a many-to-many relationship in Entity Framework, when the junction table has no FK and is not represented by a type in the model (just two relationship properties)?
"This module is like violence: if it doesn't work, you just need more of it." ... fuckit(fuckit('some_shitty_module')) # This is definitely going run now. < just lol