24 lines
694 B
C#
24 lines
694 B
C#
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
using Volo.Abp.DependencyInjection;
|
|||
|
|
using Volo.Abp.TextTemplating;
|
|||
|
|
|
|||
|
|
namespace Sozsoft.Platform.BackgroundWorkers;
|
|||
|
|
|
|||
|
|
public class PropertyTemplateContentContributor : ITemplateContentContributor, ITransientDependency
|
|||
|
|
{
|
|||
|
|
public const string PropertyContentPropertyName = "PropertyContent";
|
|||
|
|
|
|||
|
|
public PropertyTemplateContentContributor()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public virtual async Task<string> GetOrNullAsync(TemplateContentContributorContext context)
|
|||
|
|
{
|
|||
|
|
return await Task.FromResult(
|
|||
|
|
context.TemplateDefinition.Properties.GetValueOrDefault(PropertyContentPropertyName, null)?.ToString()
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|