Interface IAppTemplateService
Interface for managing templates, including retrieving, updating, and caching templates.
Namespace: DataWeb.Templating
Assembly: DataWeb.Core.dll
Syntax
public interface IAppTemplateService
Methods
GetAppTemplateAsync(string, string, CancellationToken)
Gets a template matching the specified filter.
Declaration
Task<AppTemplate> GetAppTemplateAsync(string name, string culture = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name to apply to the templates. |
| string | culture | The culture for version filtering. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<AppTemplate> | The template matching the specified name, or null if no match was found. |
GetAppTemplateContextsAsync(string, CancellationToken)
Gets all the distinct template contexts in the system.
Declaration
Task<IEnumerable<string>> GetAppTemplateContextsAsync(string culture = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | The culture for version filtering. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<string>> | A list of all the distinct template contexts in the system. |
GetAppTemplateCountAsync(AppTemplateFilter, string, CancellationToken)
Gets the count of templates matching the specified filter.
Declaration
Task<long> GetAppTemplateCountAsync(AppTemplateFilter filter, string culture = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AppTemplateFilter | filter | The AppTemplateFilter to apply to the templates. |
| string | culture | The culture for version filtering. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<long> | The count of templates matching the specified filter. |
GetAppTemplatesAsync(AppTemplateFilter, string, CancellationToken)
Gets the templates matching the specified filter.
Declaration
Task<IEnumerable<AppTemplate>> GetAppTemplatesAsync(AppTemplateFilter filter, string culture = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AppTemplateFilter | filter | The AppTemplateFilter to apply to the templates. |
| string | culture | The culture for version filtering. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AppTemplate>> | The templates matching the specified filter. |
GetContextAppTemplatesAsync(string, string, CancellationToken)
Retrieves all templates from cache.
Declaration
Task<IEnumerable<AppTemplate>> GetContextAppTemplatesAsync(string templateContext, string culture = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | templateContext | The template context. |
| string | culture | The culture for version filtering. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AppTemplate>> | An IEnumerable<T> of Template objects. |
GetImageCachedAsync(string, string, CancellationToken)
Gets a template image that matches the specified filter.
Declaration
Task<File> GetImageCachedAsync(string code, string culture, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | code | The code of the image. |
| string | culture | The culture for version filtering. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<File> | The cached image that matches the specified code. |