Exemple #1
0
 public void AddDummyData()
 {
     Clear();
     using (var db = new LiteDatabase(ConnectionString))
     {
         AddGroups(dbDummyData.CreateGroups());
         var groups = GetGroups();
         AddContacts(dbDummyData.CreateContacts(groups));
     }
 }
Exemple #2
0
        public void AddDummyData()
        {
            using (var transactionScope = new TransactionScope())
            {
                using (var db = GetDbContext())
                {
                    Clear(db.Connection);
                    var groups = dbDummyData.CreateGroups();
                    foreach (var group in groups)
                    {
                        AddGroup(db.Connection, group);
                    }

                    groups = GetGroups(db.Connection).ToList();
                    foreach (var contact in dbDummyData.CreateContacts(groups))
                    {
                        contact.Id = AddContact(db.Connection, contact);
                        InsertContactEntries(db.Connection, contact);
                    }
                    transactionScope.Complete();
                }
            }
        }
Exemple #3
0
 public void AddDummyData()
 {
     Clear();
     dbDummyData.CreateGroups().ForEach(AddGroup);
     contacts.AddRange(dbDummyData.CreateContacts(groups));
 }