I just learned about a genius type that would simplify a lot of my work but it looks like my preferred ORM does not recognize it.

Is there a workaround to let ServiceStack OrmLite recognize HierarchyId in SQL Server? Any suggestions about which files to modify and any hints how to proceed?

EDIT :

Here is a better illustration of the problem. I have the following class:

public class MyClass
{
    public int Id { get; set; }
    public SqlHierarchyId HierarchyId { get; set; }
}

SqlHierarchyId is a custom SQL Server data type. OrmLite will generate the following class for it:

First MyClass Rendering

Funny enough, I can use the [StringLength(255)] attribute on the property and it will get the varchar(255) type instead:

Second MyClass Rendering

I manually changed the table here and added the column data type to showcase the difference. Please note the data type of the third column:

SqlHierarchyId

Having a varchar representation is perfectly fine with other DBMS as it can be converted within C#, but with SQL Server it is preferable to have it match the corresponding data type. This will make the creation of views easier (due to the built-in functions of the hierarchyid data type).

I know the type is not supported by EF4 (not sure about 5). I also browsed the OrmLiteDialectProviderBa

Edit
Report