public async Task RemoveAsync(string key)
        {
            Guard.ForNull(key, nameof(key));
            var sql    = $"SELECT* FROM c where c.key = \"{key}\"";
            var entity = (await _persistedGrantCosmosStore.QuerySingleAsync(sql, feedOptions: new Microsoft.Azure.Documents.Client.FeedOptions
            {
                PartitionKey = new Microsoft.Azure.Documents.PartitionKey(key)
            }));

            if (entity == null)
            {
                return;
            }

            await _persistedGrantCosmosStore.RemoveByIdAsync(entity.Id, entity.Key);
        }
Exemplo n.º 2
0
        public async Task DeleteByIdAsync(Guid id)
        {
            var removeResult = await _cosmosStore.RemoveByIdAsync(id.ToString());

            if (!removeResult.IsSuccess)
            {
                throw removeResult.Exception;
            }
        }
        public async Task <IActionResult> Delete(Guid id, CancellationToken cancellationToken)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest());
            }

            await _peopleCosmosStore.RemoveByIdAsync(id.ToString(), cancellationToken : cancellationToken);

            return(Ok());
        }
Exemplo n.º 4
0
        public async Task <bool> DeleteArtist(string partitionKey)
        {
            var artist = await GetArtist(partitionKey);

            if (artist != null)
            {
                //Note deleting is required partitionKey
                await Store.RemoveByIdAsync(artist.ArtistId.ToString(), artist.PartitionKey);

                return(true);
            }
            return(false);
        }
        public async Task <bool> Delete(string id)
        {
            try
            {
                await store.RemoveByIdAsync(id);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public async Task <string> Handle(DeleteEbatchSheetCommand request, CancellationToken cancellationToken)
        {
            var result = await _cosmosStore.RemoveByIdAsync(request.Id,
                                                            new Microsoft.Azure.Documents.Client.RequestOptions
            {
                PartitionKey = new Microsoft.Azure.Documents.PartitionKey(Constants.EBATCH_SHEET_PARTITON_KEY)
            });

            if (result.ResourceResponse != null)
            {
                return(request.Id);
            }

            _logger.LogError("DELETE_EBATCHSHEET: EBATCHSHEET IS NOT FOUND");
            throw new NotFoundException("EbatchSheet", request.Id);
        }
Exemplo n.º 7
0
        public async Task RemoveIdentityResourceAsync(string name)
        {
            Guard.ForNull(name, nameof(name));
            var sql    = $"SELECT* FROM c where c.name = '{name}'";
            var entity = (await _identityResourceGrantCosmosStore.QuerySingleAsync(sql, feedOptions: new Microsoft.Azure.Documents.Client.FeedOptions
            {
                PartitionKey = new Microsoft.Azure.Documents.PartitionKey(name)
            }));

            if (entity == null)
            {
                return;
            }

            var response = await _identityResourceGrantCosmosStore.RemoveByIdAsync(entity.Id, entity.Name);
        }
Exemplo n.º 8
0
        public virtual async Task <IActionResult> DeleteAsync(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(BadRequest());
            }

            var response = await _cosmosStore.RemoveByIdAsync(id, _requestOptions);

            if (!response.IsSuccess)
            {
                _logger.LogInformation("Error deleting {nameof(T)} {id}. The status of the operation is {cosmosResponse.CosmosOperationStatus}", response.Exception);
            }

            return(new OkResult());
        }
Exemplo n.º 9
0
 public async Task<bool> DeletePostAsync(Guid postId)
 {
     var response =  await _cosmosStore.RemoveByIdAsync(postId.ToString(), postId.ToString());
     return response.IsSuccess;
 }
Exemplo n.º 10
0
        public async Task <bool> DeletePostAsync(Guid postId)
        {
            var response = await _CosmosStore.RemoveByIdAsync(postId.ToString(), new Microsoft.Azure.Cosmos.PartitionKey(postId.ToString()));

            return(response.IsSuccess);
        }
Exemplo n.º 11
0
 public async Task DeleteFamily(string id, string partitionKey)
 {
     await store.RemoveByIdAsync(id, partitionKey);
 }
Exemplo n.º 12
0
 public async Task Remove(Guid id)
 {
     await CosmosStore.RemoveByIdAsync(id.ToString());
 }
Exemplo n.º 13
0
        public async Task <bool> DeletePostAsync(Guid postId)
        {
            var delete = await _cosmosStore.RemoveByIdAsync(postId.ToString());

            return(delete.IsSuccess);
        }
Exemplo n.º 14
0
        public async Task <bool> DeletePost(Guid postId)
        {
            var result = await _cosmosStore.RemoveByIdAsync(postId.ToString(), postId.ToString());

            return(result.IsSuccess);
        }
Exemplo n.º 15
0
 public async Task DeletePlayer(string id)
 {
     await _cosmosStore.RemoveByIdAsync(id);
 }
Exemplo n.º 16
0
        public async Task <bool> DeleteByIdAsync(Guid id)
        {
            var deleted = await _cosmosStore.RemoveByIdAsync(id.ToString());

            return(deleted.IsSuccess);
        }
Exemplo n.º 17
0
 public Task DeleteAsync(FlatForRentAnnouncement flatForRentAnnouncement)
 {
     return(_cosmosStore.RemoveByIdAsync(flatForRentAnnouncement.Id.ToString()));
 }
        public async Task <bool> RemoveProject(string projectId)
        {
            var result = await _NoDb.RemoveByIdAsync(projectId, projectId);

            return(result.IsSuccess);
        }
Exemplo n.º 19
0
        public async Task <bool> DeleteProductAsync(Guid productID)
        {
            var response = await _cosmosStore.RemoveByIdAsync(productID.ToString(), productID.ToString());

            return(response.IsSuccess);
        }
Exemplo n.º 20
0
        public async Task <bool> DeletePostAsync(string postId)
        {
            var response = await cosmosStore.RemoveByIdAsync(postId);

            return(response.IsSuccess);
        }
Exemplo n.º 21
0
        public async Task <bool> DeleteMessageAsync(Guid messageId)
        {
            var response = await _cosmosStore.RemoveByIdAsync(messageId.ToString(), messageId.ToString());

            return(response.IsSuccess);
        }
        public async Task <IActionResult> DeleteCar(string carId)
        {
            await _cosmosStore.RemoveByIdAsync(carId);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 23
0
        public async Task <bool> DeleteOrderAsync(Guid orderId)
        {
            var response = await _cosmosStore.RemoveByIdAsync(orderId.ToString(), orderId.ToString());

            return(response.IsSuccess);
        }
Exemplo n.º 24
0
 public async Task Delete(string id)
 {
     await _store.RemoveByIdAsync(id);
 }