entity-framework-core - 运行时 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.Nullable
1,System.Nullable1<Int32>, Boolean, System.String, Boolean, System.Object, System.String, System.String, System.Nullable
1,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; }
}
解决方案
推荐阅读
- html - 仅当它是唯一具有给定类选择器的元素时才显示元素
- python - 如何返回仅包含小数点后第二位的 python 列表?
- moodle - 在moodle中限制开始一门课程直到另一门课程结束
- javascript - 使用 Javascript 在 JSP 中添加 Bootstrap 微调器
- python - Curl URL 的等效 Python 代码是什么。是否有任何教程显示如何将 curl 转换为 python?
- ios - 在 swiftui 中是否有一种简单的方法来创建像 Mail 这样的 3 层 master-context-detail 应用程序?
- list - DART/FLUTTER - 清空列表:myList.clear() 和 myList=[] 之间的真正区别是什么?
- python - ValueError:时间数据 '2021-07-28 10:27:51,834' 与格式 '&Y-%m-%d %H:%M:%S,%f' 不匹配
- azure - Azure Web 应用用户管理东方式
- python - 将 Excel 中的图表导出为 Python 中的图像