Here is a little trick if you want to issue a query to the database and select a batch of entities by ID only: This will make Entity Framework issue an SQL query with the where clause “where customerId in (1,2,3)”, and thus, you can batch select specific entities with a single query. I will…More
Entity Framework 4 – Immutable Value Objects
Ok, the title is not quire accurate, I’m not aware of any way to accomplish truly immutable types for Entity Framework. However, this is a quite nice attempt IMO: This works very well with Entity Framework 4 and I think it is a fair compromise. //RogerMore
Entity Framework 4 – First Impressions
I downloaded the VS 2010 beta1 today and started to dissect Entity Framework 4. (Also note the name: EF4.. The new name comes from .NET _4_ ) Here are my initial impressions: POCO Support. POCO comes in two flavors: Run-time POCO and Compile-time POCO: Run-time POCO is where the framework interact with your POCO types directly. This…More
Pleasing the O/R Mapper – Default Constructor Hack
Hack of the day: Most O/R mapper frameworks require entities to implement a default constructor. This is most often not a big deal, most entities would support a default constructor no matter if the mapper needed it or not. However, if you intend to expose an entity that only support a copy constructor. Let’s say…More
The simplest form of configurable Dependency Injection
I love the concept of dependency injection, but I’ve never found a dependency injection framework that I think is easy enough to use. They either rely on XML configurations that are really awkward. Others have force you to resolve objects by some untyped string ID. I don’t want that. I want to resolve my objects…More
