I'm trying out the DataStax Cassandra .NET driver and I'm attempting to implement something more complex than a bucket of strings (see https://gist.github.com/peschkaj/5794713).
When I attempt to create the table using
var table = session.GetTable<SalesOrder>();
table.CreateIfNotExists();
I get the following exception:
System.InvalidOperationException: Operation is not valid due to the current state of the object
at Cassandra.Data.Linq.CqlQueryTools.GetCqlTypeFromType (System.Type tpy) [0x00000] in <filename unknown>:0
at Cassandra.Data.Linq.CqlQueryTools.GetCreateCQL (ITable table) [0x00000] in <filename unknown>:0
at Cassandra.Data.Linq.Table`1[CassandraTest.SalesOrder].Create (ConsistencyLevel consictencyLevel) [0x00000] in <filename unknown>:0
at Cassandra.Data.Linq.Table`1[CassandraTest.SalesOrder].CreateIfNotExists (ConsistencyLevel consictencyLevel) [0x00000] in <filename unknown>:0
at CassandraTest.MainClass.Main (System.String[] args) [0x00056] in /Users/jeremiah/Projects/CassandraTest/CassandraTest/Program.cs:71
The operation fails, in part, because of the DateTime
and in part because of the custom types. What is the appropriate syntax/pattern/etc for saving complex objects back to Cassandra using the C# driver?