Files
Saxonite/SaxoniteStandardBase/Base/Consoles/SaxSessionDataConsole.cs
T
2022-02-16 10:47:45 +00:00

57 lines
2.0 KiB
C#

using Sarand.Net.Standard.Base.Bus;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Saxonite.Net.Standard.Base.Consoles
{
//=======================================================================
// Some session data is stored to the database but, to avoid potential
// performance issues in action execution, the data to store is cached and
// periodically committed in batches.
//=======================================================================
public abstract class SaxSessionDataConsole : SaErrorStateItem
{
//-------------------------------------------------------------------
// Definitions.
//-------------------------------------------------------------------
// Data members.
private SaxInternals internals = null;
//-------------------------------------------------------------------
// Construction.
protected SaxSessionDataConsole(SaxSessionContext sessionContext)
{
SessionContext = sessionContext;
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (internals != null) internals.Dispose(); internals = null;
}
}
//-------------------------------------------------------------------
// Properties.
protected SaxSessionContext SessionContext { get; }
protected SaxInternals Internals { get { if (internals == null) internals = new SaxInternals(SessionContext); return internals; } }
//-------------------------------------------------------------------
// User activity.
//-------------------------------------------------------------------
// Record latest user active time.
public abstract bool RecordUserActive(SysId userAccountId, DateTime activeAt);
//-------------------------------------------------------------------
// Data commit.
//-------------------------------------------------------------------
public abstract DateTime LastDataCommit();
//-------------------------------------------------------------------
}
//=======================================================================
}