AskiaPortalInstanceFactoryGetCurrentInstance Method |
Try to retrieve the data of current AskiaPortal instance.
Namespace:
AskiaPortalCmn
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public static IReturnValue<IAskiaPortalInstance> GetCurrentInstance(
IContext context
)
Public Shared Function GetCurrentInstance (
context As IContext
) As IReturnValue(Of IAskiaPortalInstance)
public:
static IReturnValue<IAskiaPortalInstance^>^ GetCurrentInstance(
IContext^ context
)
Parameters
- context
- Type: AskiaPortalCmnIContext
Context of execution
Return Value
Type:
IReturnValueIAskiaPortalInstance
Return the data of the current AskiaPortal instance.
Examples
Get the data of the current AskiaPortal instance.
var context = ContextFactory.CreateByUserGuid(Guid.Parse("20BE5F84-F006-49A0-9674-4B16A090AF2D"));
var contextValidation = context.Validate();
if (!contextValidation.Success)
{
throw contextValidation.Exception;
}
var result = AskiaPortalInstanceFactory.GetCurrentInstance(context);
if (!result.Success) throw result.Exception;
var instance = result.Value;
Console.WriteLine($"Licenses granted to: {instance.CompanyName}");
See Also