Class ReadRequest<T, U>
Base class for creating requests to read data.
Namespace: Kinvey
Assembly: Kinvey.dll
Syntax
public abstract class ReadRequest<T, U> : Request<T, U>
Type Parameters
Name | Description |
---|---|
T | The type of the network request. |
U | The type of the network response. |
Constructors
| Improve this Doc View SourceReadRequest(AbstractClient, String, ICache<T>, IQueryable<Object>, ReadPolicy, Boolean)
Initializes a new instance of the ReadRequest<T, U> class.
Declaration
public ReadRequest(AbstractClient client, string collection, ICache<T> cache, IQueryable<object> query, ReadPolicy policy, bool deltaSetFetchingEnabled)
Parameters
Type | Name | Description |
---|---|---|
AbstractClient | client | Client that the user is logged in. |
System.String | collection | Collection name. |
ICache<T> | cache | Cache. |
IQueryable<System.Object> | query | Query. |
ReadPolicy | policy | Read policy. |
System.Boolean | deltaSetFetchingEnabled | If set to |
ReadRequest(AbstractClient, String, ICache<T>, IQueryable<Object>, ReadPolicy, Boolean, List<String>)
Initializes a new instance of the ReadRequest<T, U> class.
Declaration
public ReadRequest(AbstractClient client, string collection, ICache<T> cache, IQueryable<object> query, ReadPolicy policy, bool deltaSetFetchingEnabled, List<String> entityIds)
Parameters
Type | Name | Description |
---|---|---|
AbstractClient | client | Client that the user is logged in. |
System.String | collection | Collection name. |
ICache<T> | cache | Cache. |
IQueryable<System.Object> | query | Query. |
ReadPolicy | policy | Read policy. |
System.Boolean | deltaSetFetchingEnabled | If set to |
List<String> | entityIds | The list of entity ids. |
Properties
| Improve this Doc View SourceCache
Gets the interface for operating with data store cache.
Declaration
public ICache<T> Cache { get; }
Property Value
Type | Description |
---|---|
ICache<T> | The instance implementing ICache<T> interface. |
Collection
Gets collection name for the request.
Declaration
public string Collection { get; }
Property Value
Type | Description |
---|---|
System.String | String value with collection name. |
DeltaSetFetchingEnabled
Indicates whether delta set fetching is enabled on this request, defaulted to false.
Declaration
protected bool DeltaSetFetchingEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EntityIDs
Gets entity ids for the request.
Declaration
protected List<string> EntityIDs { get; }
Property Value
Type | Description |
---|---|
List<System.String> | The list of entity ids |
Policy
Gets read policy for the request.
Declaration
public ReadPolicy Policy { get; }
Property Value
Type | Description |
---|---|
ReadPolicy | ReadPolicy enum value containing read policy for the request. |
Query
Gets query for the request.
Declaration
protected IQueryable<object> Query { get; }
Property Value
Type | Description |
---|---|
IQueryable<System.Object> |
Methods
| Improve this Doc View SourceBuildMongoQuery()
Builds the mongo-style query string to be run against the backend.
Declaration
protected string BuildMongoQuery()
Returns
Type | Description |
---|---|
System.String | The mongo-style query string. |
PerformLocalFind(KinveyDelegate<List<T>>)
Perfoms finding in a local storage.
Declaration
protected List<T> PerformLocalFind(KinveyDelegate<List<T>> localDelegate = null)
Parameters
Type | Name | Description |
---|---|---|
KinveyDelegate<List<T>> | localDelegate | [optional] Delegate for returning results. |
Returns
Type | Description |
---|---|
List<T> | The list of entities. |
PerformNetworkFind()
Perfoms finding in backend.
Declaration
protected Task<ReadRequest<T, U>.NetworkReadResponse<T>> PerformNetworkFind()
Returns
Type | Description |
---|---|
Task<ReadRequest.NetworkReadResponse<T>> | The async task with the request results. |
RetrieveDeltaSet(List<T>, List<DeltaSetFetchInfo>, String)
Operating with delta set data.
Declaration
protected Task<List<T>> RetrieveDeltaSet(List<T> cacheItems, List<DeltaSetFetchInfo> networkItems, string mongoQuery)
Parameters
Type | Name | Description |
---|---|---|
List<T> | cacheItems | Cache items. |
List<DeltaSetFetchInfo> | networkItems | Network items. |
System.String | mongoQuery | Mongo query. |
Returns
Type | Description |
---|---|
Task<List<T>> | The async task with the list of entities. |
RetrieveNetworkResults(String)
Retrieves entities from backend.
Declaration
protected Task<List<T>> RetrieveNetworkResults(string mongoQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | mongoQuery | Mongo query. |
Returns
Type | Description |
---|---|
Task<List<T>> | The async task with the list of entities. |