Skip to content

Exception when saving a byte array #23

Description

@sca911

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions