How can I model a hierarchyid type column in EF code-first?

entity-framework entity-framework-6 hierarchy sql-server

Question

I'm working on creating a code-based data model for the AdventureWorks2012 example database as a purely academic exercise. The first problem I have is with three type "table" columns.hieracrhyid . As VS2013 Update 4's EDM wizard "kindly" ignores these columns in the POCOs it creates, I am perfectly content to directly map these columns tostring qualities, but I'd want to have a type that really offers me those properties.hieracrhyid downstream from the actual model to table mapping, capabilities.

I've used The contribution of zgabi in the past with good results, which is a fork of the EF code that contains aHierarchyId CLR type, but in reality, I'm looking for a solution to do this without altering the EF code or using the fork. This is with the goal of eventually discovering a general approach to manage any column type that EF does not natively support. In this case, I would love to discover—or eventually create—a method of hooking into EF that would allow me to dynamically apply conversion functions between column types that EF does support and CLR ones that it does not.

1
1
3/27/2015 7:47:02 AM

Popular Answer

ZZZ_tmp
0
3/26/2015 5:45:32 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow