Click or drag to resize

ContextFactoryCreateBySessionToken Method

Creates a new context of execution using the specified AskiaField connection and the session token.

Namespace:  AskiaFieldCom
Assembly:  AskiaFieldCom (in AskiaFieldCom.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static IContext CreateBySessionToken(
	IFieldConnection connection,
	string sessionToken
)

Parameters

connection
Type: AskiaFieldComIFieldConnection
AskiaField connection object used to communicate with the AskiaField engine.
sessionToken
Type: SystemString
Token used to authenticate the user in the AskiaField engine.

Return Value

Type: IContext
New context associated to the token.
Examples

Create a context using the session token

var moduleName = "AskiaPortal";
var connectionString = "Server=(local);Database=CcaTest;Trusted_Connection=yes";
var address = "localhost";
var port = 980;
var connection = FieldConnectionFactory.Get(moduleName, connectionString, address, port);
if (!connection.Success) throw connection.Exception;
var sessionToken = "a-valid-token";
var context = ContextFactory.CreateBySessionToken(connection, sessionToken);
See Also