Partager via


VolatileMemoryStore.TryGetCollection Method

Definition

Tries to get the collection with the specified name.

protected bool TryGetCollection (string name, out System.Collections.Concurrent.ConcurrentDictionary<string,Microsoft.SemanticKernel.Memory.MemoryRecord>? collection, bool create = false);
member this.TryGetCollection : string * ConcurrentDictionary * bool -> bool
Protected Function TryGetCollection (name As String, ByRef collection As ConcurrentDictionary(Of String, MemoryRecord), Optional create As Boolean = false) As Boolean

Parameters

name
String

The name of the collection to get.

collection
ConcurrentDictionary<String,MemoryRecord>

The retrieved collection, if found.

create
Boolean

Whether to create the collection if it does not exist.

Returns

True if the collection was found or created, false otherwise.

Applies to