예제 #1
0
        public JObject Put(Guid id, string contentType, JObject entity)
        {
            using (PipelineContext context = pipeline.CreateContext(contentType, entity))
            {
                JObject prev = area.Get(id);

                entity = merger.EnsureMerge(id, entity, prev);

                entity = pipeline.ExecuteBeforePut(entity, prev, contentType, context);
                JObject closure = entity;
                entity = performance.TrackFunction(() => area.Update(id, closure), TRACK_TYPE, new { fn = $"ContentService.Put({contentType}, $ENTITY)" });
                entity = pipeline.ExecuteAfterPut(entity, prev, contentType, context);
                manager.QueueUpdate(entity);
                return(entity);
            }
        }
예제 #2
0
        public FileHeader Put(Guid id, string contentType, FileObject file)
        {
            JObject entity = area.Update(id, file.ToJson());

            FileHeader header = new FileHeader(entity);

            index.Write(header.ToJson());
            return(header);
        }