create AppendHeadContent method to consolidate logic

This commit is contained in:
sbwalker
2023-06-14 09:37:34 -04:00
parent b21d202c7f
commit bda0943d58
4 changed files with 16 additions and 25 deletions

View File

@ -14,5 +14,17 @@ namespace Oqtane.Shared
private dynamic _properties;
public dynamic Properties => _properties ?? (_properties = new PropertyDictionary());
public void AppendHeadContent(string content)
{
if (string.IsNullOrEmpty(Properties.HeadContent))
{
Properties.HeadContent = content;
}
else if (!Properties.HeadContent.Contains(content))
{
Properties.HeadContent += content;
}
}
}
}