public async Task <ActionResult> PutCheckin(int id) { var user = await GetCurrentUserAsync(); var dbActivity = _allReadyDataAccess.GetActivity(id); if (dbActivity == null || dbActivity.UsersSignedUp == null) { return(this.HttpNotFound()); } var userSignup = dbActivity.UsersSignedUp.FirstOrDefault(u => u.User.Id == user.Id); if (userSignup != null && userSignup.CheckinDateTime == null) { userSignup.CheckinDateTime = DateTime.UtcNow; _allReadyDataAccess.AddActivitySignup(userSignup); return(Json(new { Activity = new { Name = dbActivity.Name, Description = dbActivity.Description } })); } else { return(Json(new { NeedsSignup = true, Activity = new { Name = dbActivity.Name, Description = dbActivity.Description } })); } }