Example #1
0
        public IActionResult Leave(int userid, int actid)
        {
            CalandarEvent toleave = _context.CalandarEvents.FirstOrDefault(x => x.ActivityId == actid && x.UserId == userid);

            _context.CalandarEvents.Remove(toleave);
            _context.SaveChanges();
            return(RedirectToAction("Dashboard"));
        }
Example #2
0
        public IActionResult Join(int userid, int actid)
        {
            CalandarEvent tojoin = new CalandarEvent();

            tojoin.UserId     = userid;
            tojoin.ActivityId = actid;
            _context.CalandarEvents.Add(tojoin);
            _context.SaveChanges();
            return(RedirectToAction("Dashboard"));
        }