public ActionResult Delete(int id)
        {
            _resourcesRepository.Delete(id);

            TempData["Message"] = "Your resource was successfully deleted.";

            return(RedirectToAction("Index"));
        }
        public void DeleteResource(ResourceEntity resource)
        {
            ResourcesRepository resRepo = new ResourcesRepository();

            using (var uow = UnitOfWork.CreateUoW())
            {
                try
                {
                    resRepo.Delete(resource.Id, uow);
                    uow.ApplyChanges();
                }
                catch (Exception ex)
                {
                    DbLog.LogError("Error deleting resource " + resource.Id, ex);
                    throw ex;
                }
            }
        }