Exemple #1
0
        public void SaleSql_Delete_ShouldBeOk()
        {
            _venda = ObjectMotherSale.GetVenda();
            _repository.Delete(_venda);
            Venda p = _repository.Get(_venda.Id);

            p.Should().BeNull();
        }
Exemple #2
0
        public async Task <IActionResult> DeleteProduto(int id, int clienteId, int produtoId)
        {
            var venda = await repository.GetVenda(id, clienteId, produtoId);

            if (venda == null)
            {
                return(NotFound());
            }

            repository.Delete(venda);
            await unitOfWork.CompleteAsync();

            return(Ok(id));
        }
Exemple #3
0
        public GenericResult <bool> Delete(int id)
        {
            GenericResult <bool> result = new GenericResult <bool>();

            try
            {
                result.Result = service.Delete(id);
                if (!result.Result)
                {
                    result.Errors = new string[] { $"Venda {id} não existe ou não pode ser deletado" }
                }
                ;
            }
            catch (Exception ex)
            {
                result.Errors = new string[] { ex.Message };
            }

            return(result);
        }
Exemple #4
0
 public Task Delete(Guid vendaId)
 {
     return(_vendaRepository.Delete(vendaId));
 }
Exemple #5
0
 public void Delete(Venda venda)
 {
     _repository.Delete(venda);
 }
 public void Delete(Venda objeto)
 {
     _vendaRepository.Delete(objeto);
 }