Exemple #1
0
        /// <summary>
        /// Deletes the entity associated with the provided id
        /// </summary>
        /// <returns>The async task.</returns>
        /// <param name="entityID">The Kinvey ID of the entity to delete.</param>
        /// <param name="ct">[optional] CancellationToken used to cancel the request.</param>
        public async Task <KinveyDeleteResponse> RemoveAsync(string entityID, CancellationToken ct = default(CancellationToken))
        {
            RemoveRequest <T> request = new RemoveRequest <T>(entityID, client, CollectionName, cache, syncQueue, storeType.WritePolicy);

            ct.ThrowIfCancellationRequested();
            return(await request.ExecuteAsync());
        }
Exemple #2
0
        /// <summary>
        /// Deletes a list of entities by the query.
        /// </summary>
        /// <returns>KinveyDeleteResponse object.</returns>
        /// <param name="query">Expression for deleting entities.</param>
        /// <param name="ct">[optional] CancellationToken used to cancel the request.</param>
        public async Task <KinveyDeleteResponse> RemoveAsync(IQueryable <object> query, CancellationToken ct = default(CancellationToken))
        {
            if (query == null)
            {
                throw new KinveyException(EnumErrorCategory.ERROR_GENERAL, EnumErrorCode.ERROR_DATASTORE_NULL_QUERY, "Query cannot be null.");
            }

            var request = new RemoveRequest <T>(query, client, CollectionName, cache, syncQueue, storeType.WritePolicy);

            ct.ThrowIfCancellationRequested();
            return(await request.ExecuteAsync());
        }