· 9 years ago · Nov 10, 2016, 11:02 AM
1public enum DocumentState
2{
3 New = 0,
4 Approved = 1,
5 Rejected = 2
6}
7
8public class DocumentReadModel
9{
10 public Guid DocumentId { get; set; }
11 public DocumentState State { get; set; }
12}
13
14create table if not exists documentreadmodel (
15 documentid uuid PRIMARY KEY,
16 state int);
17
18MappingConfiguration.Global.Define(
19 new Map<DocumentReadModel>()
20 .TableName("documentreadmodel")
21 .PartitionKey(o => o.MerchantId)
22 .Column(o => o.State, c => c.WithName("state").WithDbType<int>()));
23
24Cassandra.InvalidTypeException:
25Unknown Cassandra target type for CLR type ValueObjects.DocumentState