Beispiel #1
0
        public IActionResult DeleteAccount(int id)
        {
            if (!AccountExists(id))
            {
                _logger.LogWarning($"Account with id: {id} does not exist.");
                return(NotFound());
            }

            _accountRepo.DeleteAccountById(id);
            _accountRepo.SaveChanges();

            _logger.LogInformation($"Account with id: {id} has been deleted.");
            return(Content($"Account with id: {id} has been deleted."));
        }