UseSqlServer method missing MVC 6

前端 未结 4 1708
甜味超标
甜味超标 2021-01-03 18:08

I am trying to implement Entity Framework 7 in MVC 6, and on this page here it says to do

services.AddEntityFramework()
    .AddSqlServer()
    .AddDbContext         


        
4条回答
  •  南方客
    南方客 (楼主)
    2021-01-03 19:01

    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

提交回复
热议问题