I'm building a WPF application, and I'm using a WebService to retrieve data from Database using Entity Framework. On my service the code generated is:
public partial class DummyEntities : ObjectContext
{
public DummyEntities() : base("name=DummyEntities", "DummyEntities")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
//more 2 constructors with diferent signature but the same code
So the Lazy Loading option is enabled.
The problem is on the app side, when I do something like this:
DummyEntities context = new DummyEntities(Utils.GetUri());
// ...
context.Order.Order_Details.Count
give me count = 0, when it shouldn't because Lazy loading is active. Am I missing something here?