This article was produced for Beta 2 & CTP2 Download the code I were having trouble with serialization of my entities over WCF using net.tcp binding when letting the ObjectContext create dynamic proxies. To solve the problem I hade to extend the DataContractSerializerOperationBehavior and provide it with the dynamic proxies as “Known types”. I also … Continue reading »
Filed under Entity framework …
Entity framework 4 – How-to reuse mappings and add a Concurrency token
I’m working on a larger sample (I will write or do a screencast about this shortly) which uses a distributed solution with WCF and the Entity framework 4 Code-only approach. Doing this I wanted to add a Concurrency token so that EF would trap concurrency violations, e.g: 1. I fetch an object which becomes detached. … Continue reading »
Entity framework 4 – Code only – How-to change target names in the database table
For a couple of days ago I got the question of “my mappings doesn’t work”. I looked at it and found that the database tables were generated upfront and not by the ObjectContext. The columnnames had other names. Than how-do you solve this missmatch if you really do want to have separate namings? Using MapSingleType. … Continue reading »
Entity framework 4 – Code-only, How-to map a combined PK
I got a question today of how to map an entity with a primarykey that is built up using two fields. The answer: using an anonymous type. The entity The mapping //Daniel
Entity framework 4 – Part 5 – Validation using Data Annotations
This post is part of a series of post where I cover different aspects of the new version of Entity framework and the CTP features. I do focus on creating a POCO solutions, hence I don’t use the designer to generate my model. Part 1 – Getting started Part 2 – Relationships between non public … Continue reading »
Entity framework 4 – Part 4 – Autoregister Entitymappings
This post is part of a serie of posts where I have been fiddeling a bit with Entity framework 4 Beta 2 and extension CTP2. The example code has evolved during the writing of this series and the goal has been to create infrastructure for persisting my entities without the need of Entity framework designers, … Continue reading »
Entity framework 4 – Part 3 – Adding pluralization support to a non strongly typed ObjectContext.
Part 1 – Getting started Part 2 – Relationships between non public members This is a post that continues on my previous post about how you could be building a ObjectContext in Entity Framework 4, without having them to be strongly typed. There’s no EDMX model etc. in your solutions. This time I’m just going … Continue reading »
Entity framework 4 – Part 2 – Relationships between non-public members
Part 1 – Getting started Part 3 – Adding pluralization support Ok, the mission of this post is to extend the code from the previous post (about dynamic and non strongly typed object-contexts) and add some relations between the entities. I will show you one way how you could setup relationships between entities where members … Continue reading »
Entity framework 4 – Part 1 – CTP 2 – Clean code with POCO entities
Part 2 – Relationships between non public members Part 3 – Adding pluralization support Ok. I have spent some hours today, fiddling a bit with the new Entity Framework (inspired by Julie Lerman at Öredev 2009). I wanted to be as POCO as possible without as much fuzz as possible. One thing that got in … Continue reading »