30 lines
949 B
C#
30 lines
949 B
C#
using Kreta.Framework.Security;
|
|
using SDA.DataProvider;
|
|
|
|
namespace Kreta.Framework.Session
|
|
{
|
|
public class ServiceSystemSession : UserContext
|
|
{
|
|
protected internal const string SessionId = "SERVICE_SYSTEM";
|
|
|
|
public ServiceSystemSession(string systemConnectionString) :
|
|
base(new LoginInfo(SessionId, 0, "127.0.0.1", int.MaxValue, SessionId), new ServiceSystemTransactionContext(systemConnectionString))
|
|
{
|
|
}
|
|
|
|
private class ServiceSystemTransactionContext : TransactionContext
|
|
{
|
|
private string connectionString;
|
|
|
|
public ServiceSystemTransactionContext(string connectionstring) : base(null)
|
|
{
|
|
connectionString = connectionstring;
|
|
}
|
|
|
|
internal override SDAConnection CreateConnection()
|
|
{
|
|
return SDAServer.Instance.CreateConnection(connectionString);
|
|
}
|
|
}
|
|
}
|
|
}
|