Esempio n. 1
0
        public IActionResult DeleteActivity(int id)
        {
            var ActivityToDelete = dbContext.Activities.FirstOrDefault(a => a.ActivityId == id);

            dbContext.Remove(ActivityToDelete);
            dbContext.SaveChanges();
            return(RedirectToAction("ShowHome", "UserAndActivity"));
        }
Esempio n. 2
0
        public IActionResult DeleteUserAndActivity(int Id)
        {
            var RecordToDelete = dbContext.UsersAndActivities.FirstOrDefault(i => i.ActivityId == Id);

            dbContext.Remove(RecordToDelete);
            dbContext.SaveChanges();
            return(RedirectToAction("ShowHome"));
        }