static void DeleteAccountsStartingWithCompany(SoqlContext context) { var accounts = from a in context.GetTable <Account>() where a.Name.StartsWith("Company") select a; foreach (var account in accounts) { context.Delete(account); } context.Save(); }
static void RenameAccountsStartingWithCompany(SoqlContext context) { var accounts = from a in context.GetTable <Account>() where a.Name.StartsWith("Company") select a; foreach (var account in accounts) { var newName = $"{account.Name}_{DateTime.Now.Ticks}"; WriteLine($"Account {account.Name} renamed to {newName}"); account.Name = newName; } context.Save(); }