UseSqlServer method missing MVC 6

我只是一个虾纸丫 提交于 2019-11-30 16:52:56

UseSqlServer is an extension method in the namespace Microsoft.Data.Entity so you need to import that in your code, like this:

using Microsoft.EntityFrameworkCore;

Install Microsoft.EntityFrameworkCore.SqlServer 1.0.1 package works for me Version of Microsoft.EntityFrameworkCore is 1.1.0

Anastasiosyal

Since this has been posted, assemblies have been renamed. As part of EntityFrameworkCore you now need to add a using statement the following

using Microsoft.EntityFrameworkCore;

And the .UseSqlServer extension method to configure your context will become available

PARAG DESHMUKH

It's a NuGet Packages Problem

Install the following Packages and with its Proper Versions

 1.  Microsoft.EntityFrameworkCore(Latest Version)
 2.  Microsoft.EntityFrameworkCore.SqlServer(1.0.4 Version)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!