ActivEarth.DAO.TeamDAO.GetCompetitorCount C# (CSharp) Method

GetCompetitorCount() public static method

Retrieves the number of competitors for a contest.
public static GetCompetitorCount ( int contestId ) : int
contestId int ID of the contest.
return int
        public static int GetCompetitorCount(int contestId)
        {
            using (SqlConnection connection = ConnectionManager.GetConnection())
            {
                var data = new ActivEarthDataProvidersDataContext(connection);
                return (from c in data.TeamMemberDataProviders
                        where c.contest_id == contestId
                        select c.id).ToList().Count;
            }
        }