|Exposing CassandraObject RawValue||hemeok||10/1/12 1:24 PM|
Fluent Cassandra newbie here....
I'm trying to serialize the FluentColumn values using a custom Json serializer. But it appears that CassandraObjects are not playing nice with the serialization tool.
The underlying types serialize just fine, but are not publicly exposed.
protected abstract object GetRawValue();
Is there some way to access the raw value that I'm missing? I ended up using reflection to call the GetRawValue() method and create the Json response.
Can we expose the raw value property or perhaps ensure that casssandra objects are serializable?
|Re: [FluentCassandra:138] Exposing CassandraObject RawValue||Nick Berardi||10/1/12 1:38 PM|
The types in Cassandra don't match the .NET types very well, so the idea with CassandraObject was to have it act as a transparent type converter. I assume that you don't have any idea of what .NET type you want it converted to which is why you are running into problems. Would this be accurate?
|Re: [FluentCassandra:138] Exposing CassandraObject RawValue||Nick Berardi||10/1/12 1:58 PM|
Since this is such a simple update, and it is probably valuable to others I have changed the GetRawValue to GetValue and made it public. You can also get the value by passing "object" in to the typed GetValue.
Secondly if you are serializing this data, you may want to consider also including the CassandraType, which is available under GetCassandraType(). This is important, because without the CassandraType you won't know from instance if it is a UUID, LexicalUUID, or TimeUUID.
Best of luck, the new version is 1.1.8 on NuGet.
|Re: [FluentCassandra:138] Exposing CassandraObject RawValue||hemeok||10/1/12 2:08 PM|
Thanks, the quick turnaround and advice.
|Re: Exposing CassandraObject RawValue||Igor Berger||10/2/12 11:03 AM|
I use FluentColumn.GetValue<string>() and deserialize that.