示例#1
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var phone = await _service.GetPhoneAsync(id);

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

                await _service.DeletePhoneItem(phone);

                return(NoContent());
            }
            catch (Exception)
            {
                return(BadRequest(ErrorCode.CouldNotDeleteEntity));
            }
        }