Exemplo n.º 1
0
        public void ResetUsersFamily(CassandraColumnFamily userFamily = null)
        {
            userFamily = userFamily ?? UserFamily;

            var db = userFamily.Context;

            userFamily.RemoveAllRows();

            foreach (var user in Users)
            {
                dynamic record = userFamily.CreateRecord(user.Id);
                if (toLower2)
                {
                    record.name  = user.Name;
                    record.email = user.Email;
                    record.age   = user.Age;
                }
                else
                {
                    record.Name  = user.Name;
                    record.Email = user.Email;
                    record.Age   = user.Age;
                }

                db.Attach(record);
            }

            db.SaveChanges();
        }