public static bool UserCompetingInContest(int userId, int contestId)
{
try
{
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
return ((from c in data.TeamMemberDataProviders
where c.user_id == userId && c.contest_id == contestId
select c.team_id).FirstOrDefault()) > 0;
}
}
catch (Exception)
{
return false;
}
}