public static float GetBadgeRequirement(Statistic stat, int badgeLevel)
{
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
float foundEntry = (from c in data.BadgeConstantsDataProviders
where c.statistic == (byte)stat && c.level == badgeLevel
select (float)c.requirement).FirstOrDefault();
return (foundEntry >= 0 ? (float)foundEntry : float.PositiveInfinity);
}
}