Entity Framework v4 (POCO) and WCF Web Services 3


Well, it’s been a busy week.  Unfortunately it hasn’t left me with much time to write any meaningful blog entries – apologies.  Last Friday I managed to implement an end-to-end solution for object graph serialization with Entity Framework (v4) POCO objects to and from WCF Web Services (note: for .Net clients only at this stage). 

It is a fairly complicated thing to explain, so I’m only going to go into detail if there is sufficient interest in the solution.  There is sufficient material to be found on the Internet (see my previous post for links), but it’s certainly not all in one place and you would have to combine aspects of a different example – in the case of supporting serialization back from the WCF client (via a generated proxy).

The summary goes something like this:

  1. Create edmx model
  2. Generate POCO entities using the template support
  3. Split the entities into a separate assembly
  4. Consume the entities and context via a Web Service (WCF) facade
  5. Implement a custom attribute to handle EF Proxies
  6. Implement a custom attribute to handle cyclic references (for entities with a self-reference) – (if needed)
  7. Implement a custom attribute to be outputted in the client proxy stub – (if needed)
  8. Use the common assembly with the client and the WCF service

So – in short – if you are interested in a detailed entry (or series of entries) please leave a comment here, otherwise I may get to the subject later in the year when I have more time (and if there is interest).

In other news, I did some work with a WinForms client and TreeView control which was my first Windows Application for quite a while.  I’ve got to say, I’m really impressed how easy it is to use TreeView controls in .Net WinForms over MFC/C++.  Back in the old days, TreeView controls were a bit tricky to work with – .Net makes it almost too easy.


About Rob Sanders

IT Professional and TOGAF 9 certified architect with nearly two decades of industry experience, 18 years in commercial software development and 11 years in IT consulting. Check out the "About Rob" page for more information.


Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

3 thoughts on “Entity Framework v4 (POCO) and WCF Web Services