Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with JsonObject, i cant insert data with json column, mysql8 #725

Closed
leobert1226 opened this issue Jan 4, 2019 · 3 comments
Closed

Comments

@leobert1226
Copy link

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<Dictionary<string,object>>, 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

@leobert1226
Copy link
Author

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

@mguinness
Copy link
Collaborator

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.

@gouhan
Copy link

gouhan commented Jan 16, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants