Exemple #1
0
        protected override Task OnDeleteAsync(Uri resourceUri, CancellationToken cancellationToken)
        {
            Content.TryRemove(resourceUri, out var content);
            ContentBytes.TryRemove(resourceUri, out var contentBytes);
            ListMock.TryRemove(resourceUri, out var item);

            return(Task.FromResult(true));
        }
Exemple #2
0
        protected override Task OnDeleteAsync(Uri resourceUri, DeleteRequestOptions deleteRequestOptions, CancellationToken cancellationToken)
        {
            if (deleteRequestOptions is DeleteRequestOptionsWithAccessCondition deleteRequestOptionsWithAccessCondition)
            {
                // Verify the access condition of this request.
                var accessCondition = deleteRequestOptionsWithAccessCondition.AccessCondition;
                AssertAccessCondition(resourceUri, accessCondition);
            }

            Content.TryRemove(resourceUri, out _);
            ContentBytes.TryRemove(resourceUri, out _);
            ListMock.TryRemove(resourceUri, out _);

            return(Task.FromResult(true));
        }