ActivEarth.DAO.ContestDAO.GetContestNameFromContestId C# (CSharp) Method

GetContestNameFromContestId() public static method

Returns the name of a contest based on its ID.
public static GetContestNameFromContestId ( int contestId ) : string
contestId int
return string
        public static string GetContestNameFromContestId(int contestId)
        {
            using (SqlConnection connection = ConnectionManager.GetConnection())
            {
                var data = new ActivEarthDataProvidersDataContext(connection);
                return (from c in data.ContestDataProviders
                        where c.id == contestId
                        select c.name).FirstOrDefault();
            }
        }