예제 #1
0
        public static void UpdatetAccounts(List <Account> accounts)
        {
            var target = SelectAccounts();

            foreach (var account in accounts)
            {
                if (target.Contains(account))
                {
                    target.Remove(account);
                }
            }
            db.ToDictionaries(target, out var deletes);
            db.Delete("account", deletes);

            db.ToDictionaries(accounts, out var upserts);
            db.Upserts("account", upserts);
        }