FileContextCore icon indicating copy to clipboard operation
FileContextCore copied to clipboard

Exception when saving a byte array

Open sca911 opened this issue 5 years ago • 1 comments

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

sca911 avatar Apr 01 '20 07:04 sca911

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

morrisjdev avatar Apr 05 '20 11:04 morrisjdev