public async Task <IEnumerable <Userd> > GetUsersNotInChallenge(int _ChallengeId, int _clubId)
        {
            if (!string.IsNullOrEmpty(Convert.ToString(_ChallengeId)) || !string.IsNullOrEmpty(Convert.ToString(_clubId)))
            {
                return(null);
            }
            else
            {
                UserChallengeEnrollmentProvider _UserChallengeEnrollmentProvider = new Business.UserChallengeEnrollmentProvider();
                var userchallenge = await _UserChallengeEnrollmentProvider.GetAll();

                ChallengeClubRelationProvider _userChallengeEnrollmentProvider = new ChallengeClubRelationProvider();
                var challengeClubRelationship = await _userChallengeEnrollmentProvider.GetAll();

                var entity = await GetAll();

                var getcheck = (
                    from u in entity
                    where !(from u1 in userchallenge.Where(a => a.ChallengeId == _ChallengeId)
                            join c1 in challengeClubRelationship.Where(a => a.ClubId == _clubId)
                            on u1.ChallengeClubRelationId equals c1.ChallengeClubRelationId
                            select new
                {
                    u1.UserId
                }).Contains(new { UserId = u.UserId }) &&
                    u.RoleId == 3
                    select new Userd
                {
                    UserId = u.UserId,
                    Name = u.FirstName + " " + u.LastName,
                    UserName = u.UserName,
                    UserRole = u.UserRole.Description
                }
                    );
                if (getcheck.Any())
                {
                    return(getcheck.ToList());
                }
                else
                {
                    var uentity = (from a in entity
                                   where a.RoleId == 3
                                   select new Userd
                    {
                        UserId = a.UserId,
                        Name = a.FirstName + " " + a.LastName,
                        UserName = a.UserName,
                        UserRole = a.UserRole.Description
                    }).Distinct();
                    return(uentity.ToList());
                }
            }
        }
        public int Insert(Enrollment _enrollment)
        {
            ChallengeClubRelationProvider _ChallengeClubRelationProvider = new ChallengeClubRelationProvider();
            var entity = _ChallengeClubRelationProvider.GetChallengeClubRelationshipSync(_enrollment.ClubId, _enrollment.ChallengeId);

            _enrollment.ChallengeClubRelationId = entity.ChallengeClubRelationId;
            UserChallengeEnrollment _userClubEnrollment = new UserChallengeEnrollment();

            _userClubEnrollment.UserId                  = _enrollment.UserId;
            _userClubEnrollment.ChallengeId             = _enrollment.ChallengeId;
            _userClubEnrollment.ChallengeClubRelationId = _enrollment.ChallengeClubRelationId;
            return(Insert(_userClubEnrollment));
        }