コード例 #1
0
ファイル: TextContentManager.cs プロジェクト: bootmarket/CMS
        public virtual void Delete(Repository repository, Schema schema, string uuid)
        {
            var textContent = schema.CreateQuery().WhereEquals("UUID", uuid).First();

            EventBus.Content.ContentEvent.Fire(ContentAction.PreDelete, textContent);
            TextContentProvider.Delete(textContent);

            EventBus.Content.ContentEvent.Fire(ContentAction.Delete, textContent);
        }
コード例 #2
0
        public void Delete()
        {
            TextContent news1 = new TextContent(repository.Name, newsSchema.Name, textFolder.FullName);

            news1["Title"] = "title1";
            news1["body"]  = "body1";
            provider.Add(news1);

            provider.Delete(news1);
        }
コード例 #3
0
ファイル: TextContentManager.cs プロジェクト: bootmarket/CMS
        public virtual void Delete(Repository repository, Folder folder, string uuid)
        {
            var textFolder = (TextFolder)folder;

            textFolder = textFolder.AsActual();
            var textContent = textFolder.CreateQuery().WhereEquals("UUID", uuid).FirstOrDefault();

            if (textContent != null)
            {
                EventBus.Content.ContentEvent.Fire(ContentAction.PreDelete, textContent);

                TextContentProvider.Delete(textContent);

                EventBus.Content.ContentEvent.Fire(ContentAction.Delete, textContent);
            }
        }
コード例 #4
0
        public void TestContentCUD()
        {
            TextContent textContent = new TextContent();

            textContent.FolderName              = newsFolder.FullName;
            textContent.SchemaName              = newsSchema.Name;
            textContent.Repository              = repository.Name;
            textContent.UtcCreationDate         = DateTime.UtcNow;
            textContent.UtcLastModificationDate = DateTime.UtcNow;
            textContent.UserKey = "userkey1";


            textContent["Title"]    = "news1";
            textContent["Comments"] = 100;

            textContentProvider.Add(textContent);

            textContent["Title"]    = "news1-updated";
            textContent["Comments"] = 101;
            textContentProvider.Update(textContent, textContent);

            textContentProvider.Delete(textContent);
        }
コード例 #5
0
 public void Test_AddCategories()
 {
     provider.Add(news1);
     provider.Add(category1);
     provider.AddCategories(news1, categories);
     provider.ClearCategories(news1);
     provider.AddCategories(news1, categories);
     provider.DeleteCategories(news1, categories);
     provider.Delete(news1);
     provider.Delete(category1);
 }