Method GetBulk
GetBulk(String[], DSReadOption)
Retrieves the object from the cache for the given keys as key value pairs. Options regarding reading from data source can be set.
Declaration
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 in case 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
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 in case 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. Data source provider name can be specified for read through operation and options for reading from data source can be specified.
Declaration
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 data source provider name for read-through operation |
DSReadOption | dsReadOption | Options regarding reading from data source |
Returns
Type | Description |
---|---|
System.Collections.IDictionary | The retrieved cache items. |