共用方式為


DistributedCacheExtensions.SetString Method

Definition

Overloads

SetString(IDistributedCache, String, String)

Sets a string in the specified cache with the specified key.

SetString(IDistributedCache, String, String, DistributedCacheEntryOptions)

Sets a string in the specified cache with the specified key.

SetString(IDistributedCache, String, String)

Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs

Sets a string in the specified cache with the specified key.

public:
[System::Runtime::CompilerServices::Extension]
 static void SetString(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, System::String ^ value);
public static void SetString (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value);
static member SetString : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string -> unit
<Extension()>
Public Sub SetString (cache As IDistributedCache, key As String, value As String)

Parameters

cache
IDistributedCache

The cache in which to store the data.

key
String

The key to store the data in.

value
String

The data to store in the cache.

Exceptions

key or value is null.

Applies to

SetString(IDistributedCache, String, String, DistributedCacheEntryOptions)

Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs

Sets a string in the specified cache with the specified key.

public:
[System::Runtime::CompilerServices::Extension]
 static void SetString(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, System::String ^ value, Microsoft::Extensions::Caching::Distributed::DistributedCacheEntryOptions ^ options);
public static void SetString (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, string value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options);
static member SetString : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * string * Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions -> unit
<Extension()>
Public Sub SetString (cache As IDistributedCache, key As String, value As String, options As DistributedCacheEntryOptions)

Parameters

cache
IDistributedCache

The cache in which to store the data.

key
String

The key to store the data in.

value
String

The data to store in the cache.

options
DistributedCacheEntryOptions

The cache options for the entry.

Exceptions

key or value is null.

Applies to