-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
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:
uBeac.Core.TemplateRendering.Repositories.MongoDBuBeac.Core.TemplateRendering.Renderers.MustacheuBeac.Core.TemplateRendering