Click or drag to resize

ModuleFactoryFindByGuid Method

Find a module using his guid, return null if not found

Namespace:  AskiaPortalCmn
Assembly:  AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax
public static IModule FindByGuid(
	IContext context,
	Guid guid
)

Parameters

context
Type: AskiaPortalCmnIContext
Context of execution
guid
Type: SystemGuid
GUID of the module to find

Return Value

Type: IModule
Return null if the module was not found
Examples

Find the module using his guid

var context = ContextFactory.CreateByUserGuid(Guid.Parse("20BE5F84-F006-49A0-9674-4B16A090AF2D"));   
var contextValidation = context.Validate();
if (!contextValidation.Success)
{
    throw contextValidation.Exception;
}
var homeGuid = Guid.Parse("9821219b-0768-41cc-81d8-cf3b1ade9317");
var homeModule = ModuleFactory.FindByGuid(context, homeGuid);
if (homeModule != null)
{
    Console.WriteLine("Module Guid={0} was found: {1}", module.Guid, module.Name);
}
else
{
    Console.WriteLine("The specified module was not found.");
}
See Also