Microsoft has an introduction article describing DbContext features.
Some of them, like filtering related entities I hadn't seen in ObjectContext.
Is that functionality really new for DbContext and not available in ObjectContext? What are the other "new" functions? Or is DbContext just a simplified API over the same functionality that ObjectContext has?
From MSDN: DbContext wraps ObjectContext and exposes the most commonly used features of ObjectContext by using simplified and more intuitive APIs. You can access the underlying ObjectContext whenever you need to use features that are not supported by DbContext.
Loading the related entities is supported, but filtering them is not supported
ObjectContext.LoadProperty
So the answer is no for loading only a part of related entities (in my opinion), DbContext offers some helper methods. You can achieve the same with ObjectContext when turning off lazy-loading and (just query for the related entities).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With