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")); }
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")); }