我正在使用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.
这些是我的项目依赖项:
[]