Indicates if the specified item is contains in the configuration of the specified module.
Namespace:
AskiaPortalCmn.Configuration
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public bool Contains(
string key,
Nullable<Guid> moduleGuid = null
)
Public Function Contains (
key As String,
Optional moduleGuid As Nullable(Of Guid) = Nothing
) As Boolean
public:
virtual bool Contains(
String^ key,
Nullable<Guid> moduleGuid = nullptr
) sealed
Parameters
- key
- Type: SystemString
Key of the config to test - moduleGuid (Optional)
- Type: SystemNullableGuid
GUID of the module from where the config belongs to.
If null or omit, the CurrentModule will be used.
Return Value
Type:
BooleanReturns True when the specified item is contains in the configuration
Implements
IConfigContains(String, NullableGuid)Examples
Indicates if the config item of `myModule` with the key `key1` is define.
using AskiaPortalCmn.Configuration;
var config = Config.GetInstance();
var myModuleGuid = Guid.Parse("0c3845fd-2465-42ca-84ba-3ab39e521098");
if (config.Contains("key1", myModuleGuid))
{
Console.WriteLine("The item `key1` is define in the config of `myModule`");
}
else
{
Console.WriteLine("The item `key1` is NOT define in the config of `myModule`");
}
See Also