Skip to content
Documentation

Session Struct

Represents a session within the database logs, grouping related log entries together.

public readonly struct Session : System.IEquatable<HAKOM.Logging.HakomDatabaseLog.Net.Api.Session>

Implements System.IEquatable<Session>

Sessions are a HAKOM-specific implementation of the concept of “scopes” in Microsoft.Extensions.Logging. A session is started by invoking BeginSession(this ILogger) and ends on disposal of the returned System.IDisposable.

Each session carries a unique HAKOM.Logging.HakomDatabaseLog.Net.Api.Session.Guid-based identity. When the session is persisted to the database, it receives a numeric Id (the call ID in the FWS_PROTOCOL table). All log entries written while the session is active are grouped under the same call ID.

This type implements System.IEquatable<> and provides equality operators (== and !=) that compare sessions by their HAKOM.Logging.HakomDatabaseLog.Net.Api.Session.Guid.

using (var session = logger.BeginSession()) // starts the session
{
logger.LogError("Some error"); // written within the session
logger.LogWarning("Some warning"); // also within the session
} // ends the session; a "Session closed" entry is written automatically

Gets a value indicating whether the session is still active or has already been ended.

public bool Active { get; }

System.Boolean
true if the session is active and accepting log entries; false if the session has been disposed and a closing entry has been written.

Gets the numeric identifier (call ID) of the session in the database.

public int Id { get; }

System.Int32
The call ID assigned by the database sequence when the session’s first entry was written, or -1 if the session has not yet been persisted.

Compares another Session to this one.

public bool Equals(HAKOM.Logging.HakomDatabaseLog.Net.Api.Session other);

other Session

The Session to compare with.

System.Boolean
True if they are the same session, false otherwise.

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj);

obj System.Object

The object to compare with the current instance.

System.Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.

Returns the hash code for this instance.

public override int GetHashCode();

System.Int32
A 32-bit signed integer that is the hash code for this instance.

A string representation of this Session object.

public override string ToString();

System.String
A string showing the Id and Active status of the session.

Session.operator ==(Session, Session) Operator

Section titled “Session.operator ==(Session, Session) Operator”

Operator overload to compare two Session instances with one another.

public static bool operator ==(HAKOM.Logging.HakomDatabaseLog.Net.Api.Session left, HAKOM.Logging.HakomDatabaseLog.Net.Api.Session right);

left Session

One of the two Sessions to compare.

right Session

The other of the two Sessions to compare.

System.Boolean
True if they are equal.

Session.operator !=(Session, Session) Operator

Section titled “Session.operator !=(Session, Session) Operator”

Operator overload to compare two Session instances with one another.

public static bool operator !=(HAKOM.Logging.HakomDatabaseLog.Net.Api.Session left, HAKOM.Logging.HakomDatabaseLog.Net.Api.Session right);

left Session

One of the two Sessions to compare.

right Session

The other of the two Sessions to compare.

System.Boolean
True if they are not equal.

© 2026 Volue.Version v0.6.38017 November 2026