Hi all
I have a C# class as like below
public class User { public string UserId { get; set; } public string Name { get; set; } public List<address> Address { get; set; } } public class Address { public string Line1 { get; set; } }
I created key space and table as below
ISession session; IMapper Mapper; Table table; var mapping = MappingConfiguration.Global.Define( new Map() .TableName(typeof(User).Name) .PartitionKey(u => u.UserId)); Dictionary<string, string> replication = new Dictionary<string, string>(); replication.Add("class", "SimpleStrategy"); replication.Add("replication_factor", "3"); var cluster = Cluster.Builder() .AddContactPoints("127.0.1") .WithPort(9042) .WithLoadBalancingPolicy(new DCAwareRoundRobinPolicy("test")) .WithReconnectionPolicy(new FixedReconnectionPolicy(400, 5000, 2 * 60000, 60 * 60000)) .Build(); session = cluster.Connect(); session.CreateKeyspaceIfNotExists("demo1", replication); session = cluster.Connect("demo1"); table = new Table<User>(session, mapping, typeof(User).Name, "demo1"); table.CreateIfNotExists();
I am getting the following error
Cassandra.InvalidTypeException: 'Unknown Cassandra target type for CLR type Casandra.Address'