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

Exception when saving a byte array #23

Open
sca911 opened this issue Apr 1, 2020 · 1 comment
Open

Exception when saving a byte array #23

sca911 opened this issue Apr 1, 2020 · 1 comment

Comments

@sca911
Copy link

sca911 commented Apr 1, 2020

Hi,
I get an exception everytime I use "context.SaveChanges()" on an object containing an byte array.
I have modified your dotnetfiddle to show this.
Exception:

Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.Byte[]' to type 'System.Object[]'.
   at FileContextCore.Serializer.SerializerHelper.Serialize(Object input)
   at FileContextCore.Serializer.JSONSerializer`1.Serialize[TKey](Dictionary`2 list)
   at FileContextCore.Storage.Internal.FileContextTable`1.<Init>b__22_0(Dictionary`2 list)
   at FileContextCore.Storage.Internal.FileContextTable`1.Save()
   at FileContextCore.Storage.Internal.FileContextStore.ExecuteTransaction(IEnumerable`1 entries, IDiagnosticsLogger`1 updateLogger)
   at FileContextCore.Storage.Internal.FileContextDatabase.SaveChanges(IReadOnlyList`1 entries)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges()
   at Program.Main()
@morrisjdev
Copy link
Owner

morrisjdev commented Apr 5, 2020

Thank you for reporting this. I'll take a look into it.

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

2 participants