public FileHeader Post(string contentType, FileObject file) { JObject entity = area.Insert(contentType, file.ToJson()); FileHeader header = new FileHeader(entity); index.Write(header.ToJson()); return(header); }
public JObject Post(string contentType, JObject entity) { using (PipelineContext context = pipeline.CreateContext(contentType, entity)) { entity = pipeline.ExecuteBeforePost(entity, contentType, context); JObject closure = entity; entity = performance.TrackFunction(() => area.Insert(contentType, closure), TRACK_TYPE, new { fn = $"ContentService.Post({contentType}, $ENTITY)" }); entity = pipeline.ExecuteAfterPost(entity, contentType, context); manager.QueueUpdate(entity); return(entity); } }