//club members public ClubMember GetMemberByID(int id) { ClubMember clubMembers; clubMembers = DbContext.ClubMember .Where(p => p.AthleteId == id && p.Status == ClubStatus.Joined) .Single(); if (clubMembers != null) { clubMembers.Club = GetClubQuery(clubMembers.ClubId); clubMembers.Athlete = _athleteRepo.GetAthletesQuery().GetAthleteByAthleteId(clubMembers.AthleteId); } return(clubMembers); }
public IEnumerable <EventRegistration> GetAll(int eventId) { ICollection <EventRegistration> evntRegs; evntRegs = DbContext.EventRegistration .Where(p => p.Deleted == false && p.EventStatus != RegistrationType.Deregistered && p.EventId == eventId) .ToList(); if (evntRegs.Count() > 0) { foreach (EventRegistration reg in evntRegs) { reg.Athlete = _athleteRepo.GetAthletesQuery().GetAthleteByAthleteId(reg.AthleteId); } } return(evntRegs); }