Example #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            _infoRepository.Delete(id);
            _infoRepository.Save();

            return(RedirectToAction("Management"));
        }
        public IActionResult OnPost(int infoId)
        {
            var deletedInfo = _infoRepository.Delete(infoId);

            _infoRepository.Commit();
            if (deletedInfo == null)
            {
                return(RedirectToPage("./NotFound"));
            }
            TempData["Message"] = $"General Info with id: { deletedInfo.Id } Deleted!";
            return(RedirectToPage("./Index"));
        }
Example #3
0
 public void Delete(string id)
 {
     try
     {
         _logger.LogInfo("InfoController Delete(string id)");
         _infoRepository.Delete(id);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex.Message);
         throw;
     }
 }
Example #4
0
 public void Delete(int id)
 {
     _infoRepository.Delete(id);
 }