public IActionResult JoinEvent(int eventID) { MemberRepo memRP = new MemberRepo(_context); EventRepo eventRP = new EventRepo(_context); var claim = HttpContext.User.Claims.ElementAt(0); string email = claim.Value; var member = memRP.GetOneByEmail(email); try { eventRP.JoinEvent(eventID, member.Id); var responseObject = new { StatusCode = "Added to the list", }; return(new ObjectResult(responseObject)); } catch { var responseObject = new { error = "can't added again", }; return(new ObjectResult(responseObject)); } }