Showing posts with label entityframework. Show all posts
Showing posts with label entityframework. Show all posts

Sep 22, 2011

Some WPF Memory Leak Gotchas

comment on this

Just a couple of insights I recently gleaned tracking down memory issues. I used the CLR Profiler and it worked well with snooping on heap allocation to find out what references were still being held onto and by what objects.

Sep 21, 2011

Regaining Automatic Relationship Fix-Up with DbContext POCO Entities

5 comments

Recently at work I upgraded the WPF application project I've been working on for a few months now to Entity Framework 4.1 so that we could take advantage of the new DbContext class. It was a snap using NuGet, too. When we started, we used database-first and then generated POCO classes via the Entity Framework POCO Generator extension plugin.

I quickly noticed some problems in our application, though. Many of the method names are different between ObjectContext and DbContext, so it required a small bit of refactoring. I didn't have any problems with this, so I didn't suspect anything, but suddenly navigation properties were coming back null when they used to not be. We've got lazy-loading disabled (because we explicitly make data loading calls on asynchronous Tasks), but I was used to navigation properties being filled whenever its associated foreign key integer value changed, provided the associated object was already cached in the context.