예제 #1
0
        public async Task DeleteAgregacoes(int id)
        {
            foreach (Agregacao a in _agregacaorepo.GetAllAgregacoesByProdutoBaseID(id).Result)
            {
                await _agregacaorepo.Delete(a.AgregacaoID);
            }

            foreach (Agregacao a in _agregacaorepo.GetAllAgregacoesByProdutoParteID(id).Result)
            {
                await _agregacaorepo.Delete(a.AgregacaoID);
            }
        }
예제 #2
0
        public async Task <IActionResult> DeleteAgregacao(int id)
        {
            var agregacao = await _agregacaoRepository.GetById(id);

            if (agregacao == null)
            {
                return(NotFound());
            }
            await _agregacaoRepository.Delete(id);

            return(Ok());
        }