entity-framework-core - Asp.net Core 2.1 中缺少 Services.CreateScope()

标签 entity-framework-core asp.net-core-2.1

什么取代了 2.1 中的 Services.CreateScope()?

我正在尝试按照本教程进行操作,但似乎内容发生了很大变化

https://dotnetthoughts.net/seed-database-in-aspnet-core/

最佳答案

我在 ASP.NET Core MVC with Entity Framework Core 教程中遇到了同样的问题,该教程是为 .NET Core 2 编写的,试图用 .NET Core 2.1 运行它。一旦我添加它就可以正常工作

using Microsoft.Extensions.DependencyInjection;

到问题文件,在我的情况下 Program.cs。

关于entity-framework-core - Asp.net Core 2.1 中缺少 Services.CreateScope(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50917101/

相关文章:

asp.net-core - 在 ASP.NET Core 2.1 Web API 中实现分页

SignalR SSE 握手失败

javascript - .NET Core 2.1 使用 React 模板 - 使用 "fetch()"时位置 0 处出现意外 token < json

c# - 使用 Fluent API 编写一对一关系

c# - EF 核心自引用

c# - 动态 LINQ 日期查询性能

c# - ASP.Net Core 2.1 中间件 WindowsPrincipal ClaimsPrincipal

c# - Angular 7 到 dotnetcore 2.1 web api 调用没有响应

c# - 带有 GraphQL 的 EF 核心

.net-core - 使用时间戳数据类型在 SQL 表中插入记录