Example #1
0
        public FileHeader Delete(Guid id, string contentType)
        {
            JObject deleted = area.Delete(id);

            if (deleted == null)
            {
                throw new FileNotFoundException();
            }

            FileHeader header = new FileHeader(deleted);

            index.Delete(header.ToJson());
            return(header);
        }
Example #2
0
        public JObject Delete(Guid id, string contentType)
        {
            JObject entity = area.Get(id);

            using (PipelineContext context = pipeline.CreateContext(contentType, entity))
            {
                pipeline.ExecuteBeforeDelete(entity, contentType, context);
                JObject deleted = performance.TrackFunction(() => area.Delete(id), TRACK_TYPE, new { fn = $"ContentService.Delete({id}, {contentType})" });
                //TODO: Throw exception if not found?
                if (deleted == null)
                {
                    return(null);
                }

                manager.QueueDelete(deleted);
                return(pipeline.ExecuteAfterDelete(deleted, contentType, context));
            }
        }