refactor: 设置默认Builder配置函数和Application配置函数
新增修改BlogEssay工具函数
This commit is contained in:
@@ -16,6 +16,22 @@ public class BlogEssay
|
||||
|
||||
public required string HtmlContent { get; init; }
|
||||
|
||||
public BlogEssay WithNewHtmlContent(string newHtmlContent)
|
||||
{
|
||||
var essay = new BlogEssay
|
||||
{
|
||||
Title = Title,
|
||||
FileName = FileName,
|
||||
PublishTime = PublishTime,
|
||||
Description = Description,
|
||||
WordCount = WordCount,
|
||||
HtmlContent = newHtmlContent
|
||||
};
|
||||
essay.Tags.AddRange(Tags);
|
||||
|
||||
return essay;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Title}-{PublishTime}";
|
||||
|
Reference in New Issue
Block a user