I'm busy with a strictly academic exercise of deriving a code-based data model for the AdventureWorks2012 sample database. My first issue is with three table columns of type hieracrhyid
. The EDM wizard in VS2013 Update 4 'kindly' just ignores these columns in the POCOs it generates, and I am quite happy to directly map these columns to string
properties, but I would like to have a type avialable that actually gives me hieracrhyid
capabilities, downstream of the actual modle to table mapping.
In the past I have quite successfully used zgabi's contribution, i.e. a fork of the EF code that includes a HierarchyId
CLR type, but I am actually trying to find a way to achieve this without modifying EF code or using the fork. This in the hope of ultimately finding a generic way to handle any column type not directly supported by EF. Here I would prefer finding, or eventually building, a mechanism for hooking into EF where I can dynamically apply conversion functions between CLR types that EF does support and column types it doesn't.
That feature is not available, but if you are brave you can use the implementation in this community contribution: http://entityframework.codeplex.com/discussions/415185