We should implement CRUD and Rendering in this phase.
uBeac.Core.TemplateRendering.Abstractions
We will have an entity:
public class ContentTemplate // inherits from base entity
{
public string UniqueKey { get; set; } // "sign-up-email"
public string? Subject { get; set; } // It's optional, "Welcome to {{SiteName}}"
public string Body { get; set; } // "Hello {{Name}}, Your account has been created successfully!"
}
And a model:
public class RenderedContent
{
public string? Subject { get; set; }
public string Body { get; set; }
}
Also, we should create a repository, service and renderer with the CRUD + rendering methods:
public interface IContentTemplateRepository // inherits from base repository
{
// CRUD methods
}
public interface IContentTemplateService // inherits from base repository
{
// CRUD methods
RenderedContent Render(ContentTemplate template, object model);
}
public interface ITemplateRenderer
{
string Render(string template, object model);
}
And, we should implement these interfaces in the another packages:
It's good to take a look at it.
https://github.com/Handlebars-Net
Handlebars have a good community and support in .NET. and we can have it next to the Mustache.
@pournasserian
We should implement CRUD and Rendering in this phase.
uBeac.Core.TemplateRendering.Abstractions
We will have an entity:
And a model:
Also, we should create a repository, service and renderer with the CRUD + rendering methods:
And, we should implement these interfaces in the another packages:
uBeac.Core.TemplateRendering.Repositories.MongoDB
uBeac.Core.TemplateRendering.Renderers.Mustache
uBeac.Core.TemplateRendering