コード例 #1
0
        public void Save(string connectionString, AccountType accountType)
        {
            if (!accountType.Exists)
            {
                if (_connection == null)
                {
                    _connection = new SqlConnection(connectionString);
                    _connection.Open();
                }

                var transaction = _connection.BeginTransaction();

                accountType.Save(_connection, transaction);
                accountType.Id     = accountType.Identity(_connection, transaction);
                accountType.Exists = true;

                transaction.Commit();
            }
        }