public void AddDummyData() { Clear(); using (var db = new LiteDatabase(ConnectionString)) { AddGroups(dbDummyData.CreateGroups()); var groups = GetGroups(); AddContacts(dbDummyData.CreateContacts(groups)); } }
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(); } } }
public void AddDummyData() { Clear(); dbDummyData.CreateGroups().ForEach(AddGroup); contacts.AddRange(dbDummyData.CreateContacts(groups)); }