public async Task <ActionResult <Articulo> > DeleteArticulo(long id) { var articuloId = await _context.Articuloes.Select(x => x.Id).FirstOrDefaultAsync(x => x == id); if (articuloId == default(int)) { return(NotFound()); } _context.Remove(new Articulo { Id = articuloId }); await _context.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult <UndMedida> > DeleteUndMedida(int id) { var unidadId = await _context.UndMedidas.Select(x => x.Id).FirstOrDefaultAsync(x => x == id); if (unidadId == default(int)) { return(NotFound()); } _context.Remove(new UndMedida { Id = unidadId }); await _context.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult <Categoria> > DeleteCategoria(int id) { var categoriaId = await _context.Categorias.Select(x => x.Id).FirstOrDefaultAsync(x => x == id); if (categoriaId == default(int)) { return(NotFound()); } _context.Remove(new Categoria { Id = categoriaId }); await _context.SaveChangesAsync(); return(NoContent()); }