首页 > 解决方案 > 运行时 EF EnsureCreatedAsync 上的“找不到方法”

问题描述

EnsureCreated()在运行时在 EF 上收到以下错误 -

System.Private.CoreLib:执行函数时出现异常:ExportFromCDSDayTime。DG.Extensions.Sharepoint.PowerHub.DeltaSync:找不到方法:'Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder 1<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.ColumnsBuilder.Column(System.String, System.Nullable1,System.Nullable 1<Int32>, Boolean, System.String, Boolean, System.Object, System.String, System.String, System.Nullable1,System.String)'。

有一个非常简单的模型

public class PKSTests
{
    public Guid Id { get; set; }
}

和上下文

{
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity(typeof(PKSTests), build =>
        {
            build.Property(typeof(Guid), "Id");
        });

        base.OnModelCreating(modelBuilder);
    }

    public DbSet<PKSTests> PKSTests { get; set; }
}

标签: entity-framework-coreazure-functions

解决方案


推荐阅读