我已经成功地实现了 EntityFramework Core 服务来与 SqlServer 一起工作,那么 Azure 呢?
这是我的代码: project.json 依赖:
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0"
还有我的 Setup.cs:
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddEntityFramework()
.AddEntityFrameworkSqlServer()
.AddDbContext<WorldContext>();
}
是否有针对云 Azure 数据库的提供商?
最佳答案
只需使用 Azure 数据库的连接字符串。 Microsoft.EntityFrameworkCore.SqlServer
适用于常规 SQL Server 和 SQL Azure。
This database provider allows Entity Framework Core to be used with Microsoft SQL Server (including SQL Azure).
来源:https://docs.efproject.net/en/latest/providers/sql-server/index.html
关于asp.net-mvc - EF 核心和 Azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38485246/