Method First
First()
Returns the first element of the List.
Declaration
T First()
Returns
Type | Description |
---|---|
T | The first element in the List. |
Examples
The following code sample shows how to get first element in Distributed List.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string dataTypeName = "DistributedList";
IDistributedList<Product> list = cache.DataTypeManager.GetList<Product>(dataTypeName);
Product product = list.First();