Show / Hide Table of Contents

Interface ISession

Describes user session

Inherited Members
IEndableInstance.IsEnded
IEndableInstance.End()
Namespace: NFX.ApplicationModel
Assembly: NFX.dll
Syntax
public interface ISession : IEndableInstance

Properties

ID

Gets unique session identifier

Declaration
Guid ID { get; }
Property Value
Type Description
System.Guid

IsJustLoggedIn

Indicates that user login happened in current request processing cycle. This flag is useful for long term token assignment on release

Declaration
bool IsJustLoggedIn { get; }
Property Value
Type Description
System.Boolean

IsNew

Indicates that session object was just created with current request processing cycle

Declaration
bool IsNew { get; }
Property Value
Type Description
System.Boolean

Item[Object]

Shortcut to this.Items.TryGetValue(...). Returns null if key is not found

Declaration
object this[object key] { get; set; }
Parameters
Type Name Description
System.Object key
Property Value
Type Description
System.Object

Items

References item dictionary that may be used to persist object graphs per session

Declaration
IDictionary<object, object> Items { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Object, System.Object>

LanguageISOCode

Returns user's language preference or null

Declaration
string LanguageISOCode { get; }
Property Value
Type Description
System.String

LastLoginType

Returns last login type

Declaration
SessionLoginType LastLoginType { get; }
Property Value
Type Description
SessionLoginType

LastLoginUTC

Returns the UTC DateTime of the last login/when HasJustLoggedIn() was called for the last time within the lifetime of this session object or NULL

Declaration
DateTime? LastLoginUTC { get; }
Property Value
Type Description
System.Nullable<System.DateTime>

OldID

When this parameter is not null then RegenerateID() was called and session provider may need to re-stow session object under a new ID

Declaration
Guid? OldID { get; }
Property Value
Type Description
System.Nullable<System.Guid>

User

References a user this session is for

Declaration
User User { get; set; }
Property Value
Type Description
User

Methods

Acquire()

Acquires session for use

Declaration
void Acquire()

HasJustLoggedIn(SessionLoginType)

Sets IsJustLoggedIn to true to indicate that user has supplied credentials/got checked via security manager. The caller of this method is implementation-specific and depends on what is considered to be "proof of users' identity"

Declaration
void HasJustLoggedIn(SessionLoginType loginType)
Parameters
Type Name Description
SessionLoginType loginType

RegenerateID()

Generates new GUID and stores it in ID storing old ID value in OldID property which is not serializable. The implementations may elect to re-stow the existing session under the new ID. This method is usefull for security, i.e. when user logs-in we may want to re-generate ID

Declaration
void RegenerateID()

Release()

Releases session after use

Declaration
void Release()

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX