by Mikael Henriksson
5. April 2010 00:13
UPDATE: I must apologize for the previously incomplete version of this class. I failed to see that in the case where we don’t have an instantiated entity there is a null EntityKey of course. This is an easy fix with extensions on the object context. using System.Data.Metadata.Edm;
using System.Dat...
[More]
by Mikael Henriksson
29. May 2009 02:56
In previous post I wrote a minor struggle about POCO. I was reading like a few 100 blog posts about EF4 and came across an interesting post about lazy loading by Julie Lerman. I agree with Rob that lazy loading should be possible to set for a specific collection and I am sure this will be possible i...
[More]
by Mikael Henriksson
29. May 2009 00:34
First of all thanks again to Microsoft for both taking the EF further towards something really powerful and usable and then special thanks to Alex James for helping the community out over on stack overflow. I started of small scale. Let’s say I want to create a blog. I have users, blogs, entries and...
[More]
by Mikael Henriksson
21. May 2009 23:09
Well first of all model first of course. Second and even more importantly is that I don’t need to think too much about related entities I can just go ahead, add stuff to my entities and then just save it all. Take the following for example. It’s probably a silly example but I’ll go ahead anywa...
[More]
by Mikael Henriksson
26. March 2009 20:42
UPDATE! You might run into problems with pluralized entity set names. Please read this post for an updated version of the generic repository. I am a very lazy person. I don’t like to repeat myself for boring tasks like data retrieval. I used to code all my repositories by hand but it took away...
[More]
by Mikael Henriksson
11. March 2009 22:50
It is a bit tricky sometimes because of the change tracking. If you start getting / setting data in different object contexts you could end up pressing the save button but not actually saving anything because the object context you use to save changes is actually not the same object context that you...
[More]
by Mikael Henriksson
27. January 2009 18:59
I have been abusing the Entity Framework lately so I thought I’d share some of what I have learned. First of all I must say there are quite a few things that need improvement. It is good that you can generate a model straight from the database and work towards your generated classes BUT! That&...
[More]
by mikael
1. January 2009 19:00
This is due to the edmx file being generated or updated from a SQL 2008 instance and run against a SQL 2005 instance. I tried about every trick I could think of before reading about it here. Basically all you need to do is to open the EDMX file with XML Editor and change ProviderManifestToken=”2008”...
[More]
by Mikael Henriksson
30. April 2008 18:59
Personally I must say that I really admire who ever decided to push the developement of the Entity Framework. Finally something extra ordinary good happened to us developers that neither have the time nor the knowledge to deep dive into all aspects of our jobs.
I did a long time ago come ...
[More]