@@ -11,6 +11,9 @@ namespace EFCore.Cassandra.Samples
1111{
1212 class Program
1313 {
14+ private static Guid ApplicantPartitionId = Guid . Parse ( "be2106c5-791f-45d2-890a-50fc221f96e8" ) ;
15+ private static Guid ApplicantId = Guid . Parse ( "09e0f68e-8818-452a-9a47-3c8ca2c941c8" ) ;
16+
1417 static void Main ( string [ ] args )
1518 {
1619 using ( var dbContext = new FakeDbContext ( ) )
@@ -19,26 +22,38 @@ static void Main(string[] args)
1922 var timeUuid = TimeUuid . NewId ( ) ;
2023 dbContext . Applicants . Add ( BuildApplicant ( ) ) ;
2124 dbContext . SaveChanges ( ) ;
25+ Console . WriteLine ( "Applicant is added" ) ;
2226
2327 var appls = dbContext . Applicants . ToList ( ) ;
28+ Console . WriteLine ( $ "Number of applicants '{ dbContext . Applicants . LongCount ( ) } '") ;
29+
30+ Console . WriteLine ( "Get applicants by partition key" ) ;
31+ var filteredApplicants = dbContext . Applicants . Where ( _ => _ . Id == ApplicantPartitionId ) . ToList ( ) ;
32+ Console . WriteLine ( $ "Number of applicants '{ filteredApplicants . Count } '") ;
2433
25- Console . WriteLine ( $ "Number of applicants : { dbContext . Applicants . LongCount ( ) } ") ;
34+ Console . WriteLine ( "Order applicants by 'order'" ) ;
35+ var orderedApplicants = dbContext . Applicants . Where ( _ => _ . Id == ApplicantPartitionId ) . OrderBy ( _ => _ . Order ) . ToList ( ) ;
36+ Console . WriteLine ( $ "Number of applicants { orderedApplicants . Count } ") ;
2637
2738 Console . WriteLine ( "Update the applicant" ) ;
2839 var applicant = dbContext . Applicants . First ( ) ;
40+ applicant = dbContext . Applicants . First ( ) ;
2941 applicant . Decimal = 10 ;
3042 applicant . Dic = new Dictionary < string , string >
3143 {
3244 { "toto" , "toto" }
3345 } ;
3446 dbContext . SaveChanges ( ) ;
47+ Console . WriteLine ( "Applicant is updated" ) ;
3548
3649 Console . WriteLine ( "Remove the applicant" ) ;
3750 applicant = dbContext . Applicants . First ( ) ;
3851 dbContext . Applicants . Remove ( applicant ) ;
3952 dbContext . SaveChanges ( ) ;
53+ Console . WriteLine ( "Applicant is removed" ) ;
4054
41- Console . WriteLine ( $ "Number of applicants : { dbContext . Applicants . LongCount ( ) } ") ;
55+ Console . WriteLine ( $ "Number of applicants '{ dbContext . Applicants . LongCount ( ) } '") ;
56+ Console . ReadLine ( ) ;
4257 }
4358 }
4459
@@ -47,7 +62,9 @@ private static Applicant BuildApplicant()
4762 var timeUuid = TimeUuid . NewId ( ) ;
4863 return new Applicant
4964 {
50- Id = Guid . NewGuid ( ) ,
65+ Id = ApplicantPartitionId ,
66+ ApplicantId = ApplicantId ,
67+ Order = 0 ,
5168 Lst = new List < string >
5269 {
5370 "1" ,
0 commit comments