ef核心3预览3. UseNetTopologySuite需要AddEntityFrameworkSqlServerNetTopologySuite

时间:2019-03-22 09:57:06

标签: entity-framework-core ef-core-pooling

我正在使用NetTopologySuite(NTS)。它基于以下文章: Spatial Data, 但是该库的版本是3.0 Preview3。

根据此question的回答呼叫UseNetTopologySuite()

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        IConfigurationRoot configuration = new ConfigurationBuilder()
       .SetBasePath(Directory.GetCurrentDirectory())
       .AddJsonFile("appsettings.json")
       .Build();
        var connectionString = configuration.GetConnectionString("Default");
        optionsBuilder.UseSqlServer(connectionString, x => x.UseNetTopologySuite());
    }

但是在执行“添加迁移”以添加迁移时,我收到此错误:

UseNetTopologySuite requires AddEntityFrameworkSqlServerNetTopologySuite to be called on the internal service provider used.

这些是我的项目依赖项:

[Project Dependencies]

0 个答案:

没有答案