Entity Framework Core - EF Core 2.2 - 'Point.Boundary' is of an interface type ('IGeometry')

前端 未结 2 1837
深忆病人
深忆病人 2021-01-05 06:16

I am trying the new functionality with EF Core 2.2. It is based on the following article. \"Announcing Entity Framework Core 2.2\" https://blogs.msdn.microsoft.com/dotnet/20

2条回答
  •  [愿得一人]
    2021-01-05 07:06

    As Kyle pointed out you need to call UseNetTopologySuite(), but I would call it during ConfigureServices like this:

    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services
                .AddEntityFrameworkNpgsql()
                .AddDbContext(opt =>
                    opt.UseNpgsql(Configuration.GetConnectionString("MyDBConnection"),
                                    o=>o.UseNetTopologySuite()))
                .BuildServiceProvider();
            ...
        }
        ...
    }
    

提交回复
热议问题