本文整理汇总了C#中Subtext.Framework.Components.Entry.ConvertToSearchEngineEntry方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.ConvertToSearchEngineEntry方法的具体用法?C# Entry.ConvertToSearchEngineEntry怎么用?C# Entry.ConvertToSearchEngineEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subtext.Framework.Components.Entry
的用法示例。
在下文中一共展示了Entry.ConvertToSearchEngineEntry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EntryExtensionMethodsTest_ConvertToSearchEngineEntry_WithTags_ConvertsTagsToString
public void EntryExtensionMethodsTest_ConvertToSearchEngineEntry_WithTags_ConvertsTagsToString()
{
Entry post = new Entry(PostType.BlogPost)
{
Blog = new Blog(){ Title="MyTitle", BlogGroupId=1},
};
IList<String> tags = new List<string>() {"tag1","tag2"};
SearchEngineEntry searchEntry = post.ConvertToSearchEngineEntry(tags);
Assert.AreEqual("tag1,tag2", searchEntry.Tags);
}
示例2: EntryExtensionMethodsTest_ConvertToSearchEngineEntry_WithOutTags_ConvertsTagsToString
public void EntryExtensionMethodsTest_ConvertToSearchEngineEntry_WithOutTags_ConvertsTagsToString()
{
Entry post = new Entry(PostType.BlogPost)
{
Blog = new Blog() { Title = "MyTitle", BlogGroupId = 1 },
Body = "<a href=\"http://blah.com/subdir/tag1/\" rel=\"tag\">tag1</a><a href=\"http://blah.com/another-dir/tag2/\" rel=\"tag\">tag2</a>"
};
SearchEngineEntry searchEntry = post.ConvertToSearchEngineEntry();
Assert.AreEqual("tag1,tag2", searchEntry.Tags);
}
示例3: EntryExtensionMethodsTest_ConvertToSearchEngineEntry_StripsHtmlTags
public void EntryExtensionMethodsTest_ConvertToSearchEngineEntry_StripsHtmlTags()
{
Entry post = new Entry(PostType.BlogPost)
{
Blog = new Blog() { Title = "MyTitle", BlogGroupId = 1 },
Body = "this is <b>bold</b> text"
};
SearchEngineEntry searchEntry = post.ConvertToSearchEngineEntry();
Assert.AreEqual("this is bold text", searchEntry.Body);
}
示例4: AddPost
public IEnumerable<IndexingError> AddPost(Entry entry, IList<string> tags)
{
return ExecuteAddPost(entry.ConvertToSearchEngineEntry(tags));
}