EntityTypeBuilder does not contain a definition for ToTable in EF Core

前端 未结 12 1478
南笙
南笙 2021-02-06 20:22

I have this sample code:

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Models;

namespace MySampleNamespace
{         


        
12条回答
  •  你的背包
    2021-02-06 20:50

    I had this problem, but did not need to install:

    Microsoft.EntityFrameworkCore.Relational
    

    I simply exited VS 2017 and re-opened my solution. I had the following NuGet packages installed:

    Microsoft.EntityFrameworkCore
    Microsoft.EntityFrameworkCore.Tools
    

    And the following CLI Tool Reference:

    Microsoft.EntityFrameworkCore.Tools.DotNet
    

提交回复
热议问题