1
Vote

PersistentBlob and "Not supported for SetColumn"

description

When creating a PersistentDictionary with a struct as value with a PersistentBlob as field "Not supported for SetColumn" is thrown.

Is this behavior by design?

comments

martinc wrote Mar 13 at 3:48 PM

Are you doing this?
struct Foo { int a; }
var myDictionary = new PersistentDictionary<Foo, PersistentBlob>();


That should work.
That exception is thrown if TValue isn't IsSerializable (as determined by ColumnConverter.cs). And PersistentBlob should be serializable.

-martin

mkosieradzki wrote Mar 13 at 5:04 PM

Thanks. No I am trying to do this:
struct Foo { int a; }
var myDictionary = new PersistentDictionary<Foo, PersistentBlob>();

struct Bar { int a; PersistentBlob b; }
var myDictionary = new PersistentDictionary<Foo, Bar>();

mkosieradzki wrote Mar 13 at 5:05 PM

Sorry for mistake in prev post, should be:

Thanks.

No I am trying to do this:
struct Foo { int a; }
struct Bar { int a; PersistentBlob b; }
var myDictionary = new PersistentDictionary<Foo, Bar>();

martinc wrote Mar 13 at 6:22 PM

Even if I mark struct Bar as Serializable, this is stil failing:
return members.Cast<FieldInfo>().All(fieldinfo => IsSerializable(fieldinfo.FieldType));

Because: ((FieldInfo)members[1]).FieldType is not serializable, because PersistentBlob is not marked as [Serializable].

Hopefully the current maintainers can comment on this. :)

-martin