Пример #1
0
        public void Remove(Guid listId, AttachmentsRemoveOptions options)
        {
            if (options.FileNames.Count == 0)
            {
                return;
            }

            var url = EnsureUrl(options.Url, listId);

            attachmentsService.Remove(url, listId, new AttachmentsRemoveQuery(options.ContentId, options.FieldName)
            {
                FileNames = options.FileNames
            });

            cacheService.Remove(CacheKey(options.ContentId, options.FieldName), CacheScope.Context | CacheScope.Process);
            cacheService.RemoveByTags(new[] { Tag(listId), ListItems.Tag(listId), Documents.Tag(listId) }, CacheScope.Context | CacheScope.Process);
        }
Пример #2
0
        public void Add(Guid listId, AttachmentsAddOptions options)
        {
            if (options.Files.Count == 0)
            {
                return;
            }

            var url = EnsureUrl(options.Url, listId);

            foreach (var file in options.Files)
            {
                attachmentsService.Add(url, listId, new AttachmentsAddQuery(options.ContentId, options.FieldName)
                {
                    FileName = file.Key,
                    FileData = file.Value
                });
            }
            cacheService.Remove(CacheKey(options.ContentId, options.FieldName), CacheScope.Context | CacheScope.Process);
            cacheService.RemoveByTags(new[] { Tag(listId), ListItems.Tag(listId), Documents.Tag(listId) }, CacheScope.Context | CacheScope.Process);
        }
 private void ExpireTags(Guid libraryId)
 {
     cacheService.RemoveByTags(new[] { Tag(libraryId), Documents.Tag(libraryId), ListItems.Tag(libraryId) }, CacheScope.Context | CacheScope.Process);
 }
 public void ExpireTags(Guid applicationId)
 {
     cacheService.RemoveByTags(new[] { Tag(applicationId), Folders.Tag(applicationId), ListItems.Tag(applicationId) }, CacheScope.Context | CacheScope.Process);
 }