我想使用EF Core,但是我需要在其中一个表格中使用sql server数据类型hierarchyid
。
是否可以将我的C#类中的某个字段指定为hierarchyid
类型?
我能否手动将EF创建的列更改为hierarchyid
类型而不破坏EF?
编辑: 我已经尝试过:
public class Entity
{
public int Id { get; set; }
public string Name { get; set; }
public SqlHierarchyId HierarchyId { get; set; }
}
虽然EF Core 2.1支持此功能,但是当我运行add-migration时,出现了以下错误:
The current CSharpHelper cannot scaffold literals of type 'Microsoft.SqlServer.Types.SqlHierarchyId'. Configure your services to use one that can.