abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.86k stars 3.43k forks source link

NetTopologySuite spatial service is not registered. #17353

Open zizoumurat opened 1 year ago

zizoumurat commented 1 year ago

Is there an existing issue for this?

Description

Hi,

I have use Devart.Data.Oracle.EFCore 10.1.151.7.

I get "NetTopologySuite spatial service is not registered." error on insert/update

Version

7.3 (latest)

User Interface

MVC

Database Provider

EF Core (Default)

maliming commented 1 year ago
visualsoft-consulting commented 1 year ago

Hi,

I get the exception too. My StackTrace:

at Devart.Common.Entity.EntitySpatialServices.b()
   at Devart.Common.Entity.cr.d(IColumnModification A_0)
   at Devart.Data.Oracle.Entity.an.b0(IColumnModification A_0)
   at Devart.Common.Entity.cq.e()
   at Devart.Common.Entity.cq.Complete(Boolean moreBatchesExpected)
   at Microsoft.EntityFrameworkCore.Update.Internal.CommandBatchPreparer.CreateCommandBatches(IEnumerable`1 commandSet, Boolean moreCommandSets, Boolean assertColumnModification, ParameterNameGenerator parameterNameGenerator)+MoveNext()
   at Microsoft.EntityFrameworkCore.Update.Internal.CommandBatchPreparer.BatchCommands(IList`1 entries, IUpdateAdapter updateAdapter)+MoveNext()
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)

Exception Message: NetTopologySuite spatial service is not registered. Exception Source: Devart.Data.Oracle.Entity.EFCore

In my C# class:

            Context.Update(entity);
            int result = await Context.SaveChangesAsync(cancellationToken);

I am using: Microsoft.EntityFrameworkCore 7.0.10 Devart.Data.Oracle.EFCore 10.1.151.7

Thank you!

zizoumurat commented 1 year ago

hi @visualsoft-consulting

add "Devart.Data.Oracle.EFCore.NetTopologySuite" package and add UseNetTopologySuite() method in this line :

c.UseOracle(b => { b.UseNetTopologySuite(); });

visualsoft-consulting commented 1 year ago

Hi @zizoumurat,

thank you! But I do not understand, why I have to add an unnecessary dependency/package. It should work without the Topology Package.