I am currently working on my NoSQL project and I have two databases Cassandra and Redis (I am using Redis for caching). Now with Redis I have one list and I serialize my custom object using DataContract, but when it comes to Cassandra I am struggling since I am trying to somehow insert Guid in Cassandra table, in which I am using uuid as primary key. I have searched the Internet and all I could find was that Guid is Cassandra's uuid type of data. I have inserted uuid using now() in Cassandra so I am wondering if I could somehow invoke that now() from C# or if I can somehow convert Guid to uuid. Any help or reference is much appreciated. Thank you.
Asked
Active
Viewed 823 times
1 Answers
7
Per driver documentation, uuid
is already mapped into Guid
and back... So you can simply bind your variable into corresponding placeholder in statement.

Alex Ott
- 80,552
- 8
- 87
- 132
-
Thanks, this was an obvious one but could not find the solution. Thank you, once again. – nikjov92 Jan 18 '18 at 20:02
-
See https://github.com/datastax/csharp-driver/blob/master/src/samples/CassandraSamples/ForumRepository.cs as example of working with `Guid` – Alex Ott Jan 18 '18 at 20:06
-
I didn't see this earlier. Thank you for sharing. – nikjov92 Jan 18 '18 at 20:38