Skip to content

Implement Template Engine #158

@ilhesam

Description

@ilhesam

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.MongoDB
  • uBeac.Core.TemplateRendering.Renderers.Mustache
  • uBeac.Core.TemplateRendering

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions