Merge pull request #2964 from ludovic-henry/sgen-monocontext
[mono.git] / mcs / class / referencesource / System.Web / Util / SecUtil.cs
index 567446cea96a6181d5e35cb31e09ba6f1ae883e1..9a104eabbf598ee8deff7ab499926c6935696e05 100644 (file)
@@ -215,6 +215,17 @@ namespace System.Web.Util {
             return iValue;
         }
 
+        internal static int? GetNullableIntValue(NameValueCollection config, string valueName) {
+            int iValue;
+            string sValue = config[valueName];
+
+            if (sValue == null || !Int32.TryParse(sValue, out iValue)) {
+                return null;
+            }
+
+            return iValue;
+        }
+
 #if !FEATURE_PAL //
         internal static void CheckSchemaVersion(ProviderBase provider, SqlConnection connection, string[] features, string version, ref int schemaVersionCheck) {
             if (connection == null) {