Beispiel #1
0
        public IHttpActionResult Delete(string id)
        {
            Log.Information($"Deleting file {id}.");
            var descriptor = _repository.LoadObject <FileDescriptor>(id);

            if (descriptor == null)
            {
                Log.Information($"File {id} not found.");
                return(Ok());                // DELETE is indempotent
            }

            _repository.Delete(descriptor.ProcessingInfoId);
            _repository.DeleteStream(descriptor.BlobId);
            _repository.Delete(id);

            Log.Information($"File {id} deleted.");
            return(Ok());
        }