Method GetBulk
GetBulk(String[], DSReadOption)
Retrieves the object from the cache for the given keys as key value pairs
Declaration
[TargetMethod(1)]
public virtual IDictionary GetBulk(string[] keys, DSReadOption dsReadOption)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | keys | The keys against which items are to be fetched. |
DSReadOption | dsReadOption | Options regarding reading from data source |
Returns
Type | Description |
---|---|
System.Collections.IDictionary | The retrieved cache items. |
Remarks
Note: If exceptions are enabled through the ExceptionsEnabled setting, this property throws exception incase of failure.
Examples
The following example demonstrates how to retrieve the value cached for an ASP.NET text box server control.
Cache cache = NCache.InitializeCache("myCache");
string[] keys = new string[]{"myItem1", "myItem2"};
IDictionary items = cache.Get(keys, DSReadOption.ReadThru);
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
GetBulk(String[])
Retrieves the object from the cache for the given keys as key value pairs
Declaration
[TargetMethod(2)]
public virtual IDictionary GetBulk(string[] keys)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | keys | The keys against which items are to be fetched. |
Returns
Type | Description |
---|---|
System.Collections.IDictionary | The retrieved cache items. |
Remarks
Note: If exceptions are enabled through the ExceptionsEnabled setting, this property throws exception incase of failure.
Examples
The following example demonstrates how to retrieve the value cached for an ASP.NET text box server control.
Cache cache = NCache.InitializeCache("myCache");
string[] keys = new string[]{"myItem1", "myItem2"};
IDictionary items = cache.Get(keys);
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
GetBulk(String[], String, DSReadOption)
Retrieves the object from the cache for the given keys as key value pairs
Declaration
[TargetMethod(3)]
public virtual IDictionary GetBulk(string[] keys, string providerName, DSReadOption dsReadOption)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | keys | The keys against which items are to be fetched. |
System.String | providerName | The datasource provider name for read-through operation |
DSReadOption | dsReadOption | Options regarding reading from data source |
Returns
Type | Description |
---|---|
System.Collections.IDictionary | The retrieved cache items. |