Exemple #1
0
        public Folder GetFolderById(object id)
        {
            var key    = "spointd-" + MakeId(id);
            var folder = FolderCache.Get <Folder>(key);

            if (folder == null)
            {
                folder = GetFolder(id);
                FolderCache.Insert(key, folder, DateTime.UtcNow.Add(CacheExpiration));
            }
            return(folder);
        }
        public Folder CreateFolder(string id)
        {
            Notify.Publish(new SharePointProviderCacheItem {
                FolderKey = MakeId(GetParentFolderId(id))
            }, CacheNotifyAction.Remove);

            var folder = clientContext.Web.RootFolder.Folders.Add(id);

            clientContext.Load(folder);
            clientContext.ExecuteQuery();

            FolderCache.Insert("spointd-" + id, folder, DateTime.UtcNow.Add(CacheExpiration));

            return(folder);
        }