将 EFCore 映射到 oracle 自定义复合类型

时间:2021-06-16 17:40:30

标签: c# .net oracle11g entity-framework-core

所以我有一个包含类型列的表......我们称之为 STAMP:

CREATE TYPE STAMP( 
    timestamp DATE, 
    num INTEGER 
)

很自然地,我的 EF 模型具有 Stamp 类型的属性:

public class Stamp
{
  public DateTime Timestamp { get; set; }
  public int Num { get; set; }
}

但我收到错误 The property Table.From is of type 'Stamp' which is not supported by the current database provider

我该如何映射? EFCore issue on github 似乎已关闭。

1 个答案:

答案 0 :(得分:1)

它被称为用户定义类型 (UDT)。目前它不受 Oracle.ManagedDataAccess.Core 支持。而且可以肯定的是,EF Core Oracle 提供程序不支持它。

跟踪问题:https://github.com/oracle/dotnet-db-samples/issues/56