Entity Framework HierarchyId Workarounds

后端 未结 2 670
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 07:38

EF 5.0

I am working on a prototype to test hierarchyid and entity framework together. I have the following schema:

Create Table dbo.Employee
(
   Emp         


        
2条回答
  •  半阙折子戏
    2020-12-13 08:06

    Using varbinary(892) instead of hierarchyid. EF recognizes varbinary returning byte array. You can convert byte array to SqlHierarchyid type and use hyrarchy pod functions. With this workaround you can use hierarchyid functions even in other databases. See http://www.casavillar.com.br/blog with more details and links to nugget and github where you will find samples including MySql

提交回复
热议问题