public async Task <IActionResult> DeleteColor(int id) { var checkColorInProducts = await _prodRepo.AllItems.FirstOrDefaultAsync(p => p.ColorId == id); if (checkColorInProducts == null) { if (await _repo.DeleteItemAsync(id)) { return(Ok()); } } return(BadRequest()); }