DbSet 包含生成不正确的 SQL (Devart DotConnect Oracle)

DbSet Include Generates Incorrect SQL (Devart DotConnect Oracle)

我正在使用 Devart DotConnect For Oracle 和 EF Core 2.0.1。当我执行下面的代码时 Entity Framework 生成错误的 SQL。我认为这是一个错误,但是我不确定我是否是犯错误的人。而且,我需要一个解决方法来解决这个问题。

public virtual async Task<TEntity> GetByIdAsync(object[] keyValues,
    List<Expression<Func<TEntity, object>>> includes,
    CancellationToken cancellationToken = default(CancellationToken))
{
    Task<TEntity> model = null;

    foreach (var include in includes)
    {
            await DbSet.Include(include).LoadAsync(cancellationToken);
            model = DbSet.FindAsync(keyValues, cancellationToken);
    }

    if (model == null)
        model = DbSet.FindAsync(keyValues, cancellationToken);

    return await model;
}

以下代码生成

下面的 SQL
SELECT
"product.MhpProducts".mp_mhp_id,
"product.MhpProducts".mp_product_id,
"product.MhpProducts".mp_g_order,
"product.MhpProducts".g_end_date,
"product.MhpProducts".g_insert_by,
"product.MhpProducts".g_insert_date,
"product.MhpProducts".g_is_deleted,
"product.MhpProducts".g_start_date,
"product.MhpProducts"."mp_west_core._domain._entities._west_life._mhp_product"
FROM   mhp_product "product.MhpProducts"
       inner join (SELECT "product0".tp_id
                   FROM   tree_product "product0") "t"
               ON "product.MhpProducts".mp_product_id = "t".tp_id
ORDER  BY "t".tp_id  

我解决了这个问题。问题实际上是由 .HasForeignKey(typeof(ExampleEntity), @"Id") 引起的。我将此行更改为 .HasForeignKey("Id") 并且它起作用了。我不知道为什么那条线炸毁了查询生成