コード例 #1
0
        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());
        }