示例#1
0
        public async Task TestData()
        {
            await _dbContext.CreateClusterAsync <TestUser>();

            // Inserting Data into user table
            _dbContext.InsertIfNotExists <TestUser>(new TestUser(1, "LyubovK", "Dubai"));
            _dbContext.InsertIfNotExists <TestUser>(new TestUser(2, "JiriK", "Toronto"));
            _dbContext.InsertIfNotExists <TestUser>(new TestUser(3, "IvanH", "Mumbai"));
            _dbContext.InsertIfNotExists <TestUser>(new TestUser(4, "LiliyaB", "Seattle"));
            _dbContext.InsertIfNotExists <TestUser>(new TestUser(5, "JindrichH", "Buenos Aires"));
            Console.WriteLine("Inserted data into user table");
        }
 public void CreateKeyspace()
 {
     _dbContext.CreateClusterAsync <UserDetails>().Wait();
 }