ContextFactoryCreateForSuperAdmin Method |
Creates a new context of execution for the super administrator.
Namespace: AskiaPortalCmn
The context created will not be restricted.
You may check the validity of the context using Validate
This example shows how to create for super administrator.
using system; using AskiaPortalCmn; namespace MyApp { class Program { static void Main(string[] args) { var context = ContextFactory.CreateForSuperAdmin(); var validationResult = context.Validate(); if (validationResult.Success) { Console.WriteLine("Context successfully created for the super administrator `{0} {1} ({2})`", context.User.FirstName, context.User.LastName, context.User.Login); } else { Console.Error.WriteLine("Unable to create the context"); Console.Error.Write(validationResult.Exception.Message); } } } }