ISessionStateItemCollection Interface

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Defines the contract for the collection used by ASP.NET session state to manage session.

Namespace:   System.Web.SessionState
Assembly:  System.Web (in System.Web.dll)

type ISessionStateItemCollection = 
    interface
        interface ICollection
        interface IEnumerable
    end

NameDescription
System_CAPS_pubpropertyCount

Gets the number of elements contained in the ICollection.(Inherited from ICollection.)

System_CAPS_pubpropertyDirty

Gets or sets a value indicating whether the collection has been marked as changed.

System_CAPS_pubpropertyIsSynchronized

Gets a value indicating whether access to the ICollection is synchronized (thread safe).(Inherited from ICollection.)

System_CAPS_pubpropertyItem(Int32)

Gets or sets a value in the collection by numerical index.

System_CAPS_pubpropertyItem(String)

Gets or sets a value in the collection by name.

System_CAPS_pubpropertyKeys

Gets a collection of the variable names for all values stored in the collection.

System_CAPS_pubpropertySyncRoot

Gets an object that can be used to synchronize access to the ICollection.(Inherited from ICollection.)

NameDescription
System_CAPS_pubmethodClear()

Removes all values and keys from the session-state collection.

System_CAPS_pubmethodCopyTo(Array, Int32)

Copies the elements of the ICollection to an Array, starting at a particular Array index.(Inherited from ICollection.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that iterates through a collection.(Inherited from IEnumerable.)

System_CAPS_pubmethodRemove(String)

Deletes an item from the collection.

System_CAPS_pubmethodRemoveAt(Int32)

Deletes an item at a specified index from the collection.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<'TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<'TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

The ISessionStateItemCollection interface defines the collection of session items exposed to application code by the HttpSessionStateContainer class.

The ASP.NET implementation of the ISessionStateItemCollection interface is the SessionStateItemCollection class.

If you create a class derived from the SessionStateStoreProviderBase class to store session data, you can either use the SessionStateItemCollection class to manage the stored objects or implement the ISessionStateItemCollection interface on your own collection manager.

If you implement the ISessionStateItemCollection interface, you must also create a class that inherits the SessionStateStoreProviderBase class in order to make use of your ISessionStateItemCollection implementation to manage session variables.

An ISessionStateItemCollection implementation must also implement the members of the ICollection interface.

The following code example implements the ISessionStateItemCollection and uses the SortedList class to store session-state variable names and values.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: