IBotDataBag IBotDataBag IBotDataBag Interface

Definition

A property bag of bot data.

public interface IBotDataBag
type IBotDataBag = interface
Public Interface IBotDataBag

Properties

Count Count Count

Gets the number of key/value pairs contained in the IBotDataBag.

public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer
Value
Int32 Int32 Int32

Methods

Clear() Clear() Clear()

Removes all of the values from data bag.

public void Clear ();
abstract member Clear : unit -> unit
Public Sub Clear ()

ContainsKey(String) ContainsKey(String) ContainsKey(String)

Checks if data bag contains a value with specified key

public bool ContainsKey (string key);
abstract member ContainsKey : string -> bool
Public Function ContainsKey (key As String) As Boolean
Parameters
key
String String String

The key.

Returns

RemoveValue(String) RemoveValue(String) RemoveValue(String)

Removes the specified key from the bot data bag.

public bool RemoveValue (string key);
abstract member RemoveValue : string -> bool
Public Function RemoveValue (key As String) As Boolean
Parameters
key
String String String

They key of the element to remove

Returns

True if removal of the key is successful; otherwise, false

SetValue(String, T) SetValue(String, T) SetValue(String, T)

Adds the specified key and value to the bot data bag.

public void SetValue<T> (string key, T value);
abstract member SetValue : string * 'T -> unit
Public Sub SetValue(Of T) (key As String, value As T)
Type Parameters
T

The type of the value to get.

Parameters
key
String String String

The key of the element to add.

value

The value of the element to add. The value can be null for reference types.

TryGetValue(String, T) TryGetValue(String, T) TryGetValue(String, T)

Gets the value associated with the specified key.

public bool TryGetValue<T> (string key, out T value);
abstract member TryGetValue : string *  -> bool
Public Function TryGetValue(Of T) (key As String, ByRef value As T) As Boolean
Type Parameters
T

The type of the value to set.

Parameters
key
String String String

The key of the value to get.

value

When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns

true if the IBotDataBag contains an element with the specified key; otherwise, false.

Applies to