Exemplo n.º 1
0
        public async Task <bool> DeleteAsync(DroidId serialNumber, DeleteArmListAction previousActions)
        {
            if (!await previousActions.Action(previousActions.SerialNumbers, null).ConfigureAwait(false))
            {
                return(false);
            }

            if (!await DeleteInternalAsync(serialNumber).ConfigureAwait(false))
            {
                return(false);
            }

            return(true);
        }
        public async Task <bool> DeleteAsync(DroidId serialNumber, DeleteArmListAction previousActions)
        {
            using (var transaction = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                using (var connection = _connectionProvider())
                {
                    if (!await previousActions.Action(previousActions.SerialNumbers, connection))
                    {
                        return(false);
                    }

                    if ((await ExecuteDeleteAsync(serialNumber, connection)) > 0)
                    {
                        transaction.Complete();
                        return(true);
                    }
                }

            return(false);
        }