public static GetString ( this collection, string key, string defaultValue = null ) : string | ||
collection | this | |
key | string | |
defaultValue | string | |
return | string |
public static string GetString(this NameValueCollection collection, string key, string defaultValue = null)
{
Condition.Requires(key, "key").IsNotNullOrWhiteSpace();
if (collection == null)
{
return defaultValue;
}
return collection.Get(key) ?? defaultValue;
}
}