public async Task <ActionResult <int> > Delete([FromRoute] int id)
        {
            // Delete
            await _termsRepository.RemoveTerm(id);

            // Return
            return(Ok(id));
        }
Esempio n. 2
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                // Delete
                await _termsRepository.RemoveTerm(id);

                // Return
                return(Ok(id));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Deletion failed for term. {User} {Term}", _userManager.GetUserId(User), id);
                return(StatusCode(500, $"Deletion failed for term. Please try again. {e.Message}"));
            }
        }