Pomelo.entityframeworkcore.mysql: Problem with JsonObject, i cant insert data with json column, mysql8

Created on 4 Jan 2019  ·  3Comments  ·  Source: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql

Steps to reproduce

my menu class:
default

Startup.cs:
default

The issue

when try to insert a menu like this

default

it cant work,. then i change property route to JsonObject and JsonObject>, i cant work.

Exception message:
System.NullReferenceException:“Object reference not set to an instance of an object.”

Stack trace:
   at System.JsonObject`1.Equals(JsonObject`1 other)
   at lambda_method(Closure , InternalEntityEntry )
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.OriginalValues..ctor(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues()
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState entityState, Boolean acceptChanges, Nullable`1 forceStateWhenUnknownKey)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode node, Boolean force)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode node, TState state, Func`3 handleNode)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState entityState, Boolean forceStateWhenUnknownKey)
   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState(InternalEntityEntry entry, EntityState entityState)
   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState[TEntity](TEntity entity, EntityState entityState)
   at Microsoft.EntityFrameworkCore.DbContext.Add[TEntity](TEntity entity)
   at ZhiYuan.ISMS.Web.Controllers.AccountController.Login(String returnUrl) in D:\Git\Core\ZyISMS\ZhiYuan.ISMS.Web\Controllers\AccountController.cs:line 52
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()

Further technical details

MySQL version: 8.0.13
Operating system: windows 10
Pomelo.EntityFrameworkCore.MySql version: 2.1.4
.net core version: 2.2.0

Most helpful comment

The provider library version number is tightly coupled to the upstream EF library, so you will have to wait for version 2.2 to be released which has yet to be announced.

All 3 comments

i tried the same codes under .net core 2.1, it worked.
how cani fix it in .net core 2.2?

The provider library version number is tightly coupled to the upstream EF library, so you will have to wait for version 2.2 to be released which has yet to be announced.

@mguinness ,hi.
How long will the new version package released?
In worry.

Was this page helpful?
0 / 5 - 0 ratings