Share via


DataCache.BulkGet Method

Returns objects for the specified keys from the specified region of the cache.

Namespace: Microsoft.ApplicationServer.Caching
Assembly: Microsoft.ApplicationServer.Caching.Client (in microsoft.applicationserver.caching.client.dll)

Usage

'Usage
Dim instance As DataCache
Dim keys As IEnumerable(Of String)
Dim region As String
Dim returnValue As IEnumerable(Of KeyValuePair(Of String, Object))

returnValue = instance.BulkGet(keys, region)

Syntax

'Declaration
Public Function BulkGet ( _
    keys As IEnumerable(Of String), _
    region As String _
) As IEnumerable(Of KeyValuePair(Of String, Object))
public IEnumerable<KeyValuePair<string,Object>> BulkGet (
    IEnumerable<string> keys,
    string region
)
public:
IEnumerable<KeyValuePair<String^, Object^>>^ BulkGet (
    IEnumerable<String^>^ keys, 
    String^ region
)
public IEnumerable<KeyValuePair<String,Object>> BulkGet (
    IEnumerable<String> keys, 
    String region
)
public function BulkGet (
    keys : IEnumerable<String>, 
    region : String
) : IEnumerable<KeyValuePair<String,Object>>

Parameters

  • keys
    List of keys for the objects to retrieve, cannot be null.
  • region
    Name of the region, cannot be null.

Return Value

Returns an IEnumerable object with a list of key and value pairs.

Remarks

Parameter validation behavior:

  • If the keys or region parameter is null, or any key in the keys list is null, BulkGet will throw a System.ArgumentNullException object for the null parameter.

  • If the specified region is not present, BulkGet will return a null IEnumerable object.

  • If a key is not present in the region, the object returned by the enumerator for the key will be null. For example, the key/value pair returned would be <key,null>.

Performance considerations - BulkGet improves performance when used with small objects, for example, when retrieving many objects of 1 - 5KB or less in size. When using BulkGet to retrieve large objects, for example objects larger than 64 KB, BulkGet will not significantly improve performance and in fact may adversely impact performance. This reduced performance can occur because large bulk get responses are split into multiple single object responses to avoid large object heap usage.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Visual Studio 2010 and later, .NET Framework 4

Target Platforms

Windows 7; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2

See Also

Reference

DataCache Class
DataCache Members
Microsoft.ApplicationServer.Caching Namespace

  ff425062(v=azure.10).md 2011-08-26