public async Task <IActionResult> DeleteConfirmed(string id)
        {
            try
            {
                await programmeRepository.DeleteProgrammeAsync(id);

                await programmeRepository.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            catch (DataAccessException e)
            {
                ViewBag.ErrorMsg = ErrorProcessing.ProcessException("Data Access exception. ", e);
                return(RedirectToAction("Delete", "Error", new { errorMsg = ViewBag.ErrorMsg }));
            }
            catch (Exception e)
            {
                ViewBag.ErrorMsg = ErrorProcessing.ProcessException("General exception. ", e);
                return(RedirectToAction("Unknown", "Error"));
            }
        }
        public async Task <IActionResult> DeleteProgrammeAsync(string id)
        {
            try
            {
                var programmeFromDb = await _programmeRepository.FindByIdAsync(id);

                if (programmeFromDb == null)
                {
                    return(NotFound($"Programme {id} not found"));
                }

                await _programmeRepository.DeleteProgrammeAsync(id);

                await _programmeRepository.SaveChangesAsync();

                return(NoContent());
            }
            catch (DataAccessException e)
            {
                _logger.LogError(e, $"Delete programme {id} failed.");
                return(BadRequest($"Delete of {id} failed"));
            }
        }