I'm not used to the data type, but I've carried out some investigations.
Seems like this type is supported only inside the SQL Server both natively and in hosted CLR. Getting it outside requires it to be converted to a string (see Data Type Conversion section here).
I think the only way is creating a view in the database converting the hierarchyid
to nvarchar(4000)
. To make it updatable you can either define a set of insert/update/delete triggers for that view, or create a set of corresponding stored procedures and map them to the EF context. I don't remember if EF Code First is capable of using SPs for modification operations, but an updatable view should be fine since it looks like an ordinary table.
Hope this helps.