Closed best0032001 closed 3 years ago
Hi,
In cassandra you cannot define foreign key because it's not a relational database, the website https://docs.datastax.com/en/cql-oss/3.3/cql/ddl/dataModelingApproach.html explains how to model your database.
I'm going to make some modifications on the project to support "list<frozen
The sample project has been updated in the branch "origin/release/2.0.5" : https://github.com/simpleidserver/EFCore.Cassandra/tree/release/2.0.5/samples/EFCore.Cassandra.Samples.
The application can have one or more phones (a phone is defined as a UDT / User Defined Type).
In the configuration, there is a new UDT:
modelBuilder.Entity<ApplicantPhone>()
.ToUserDefinedType("applicant_phone")
.HasNoKey();
A new navigation property "public ApplicantPhone[] Phones { get; set; }" has been added into the "Applicant".
I read document in https://efcorecassandra.readthedocs.io/en/latest/intro/getting-started-with-efcorecassandra.html#configure-tables
Then example in Document I found this
modelBuilder.Entity<Applicant>() .ToTable("applicants", "cv") .HasKey(p => new { p.Id, p.LastName }); modelBuilder.Entity<Applicant>() .ForCassandraSetClusterColumns(s => new { s.LastName });
I want to Design Model type Single navigation property like this
public class Blog { public int BlogId { get; set; } public string Url { get; set; }
} public class Post { public int PostId { get; set; } public string Title { get; set; } public string Content { get; set; } } this referrance https://docs.microsoft.com/en-us/ef/core/modeling/relationships?tabs=fluent-api%2Cfluent-api-simple-key%2Csimple-key
How to Configure tables Just like this in EFCore.Cassandra v 2.0.3