ModelsAsync<TModel>(IRedaktContext, IEnumerable<string>, Func<TModel, bool>, Nullable<CultureInfo>)
Gets a list of view models for the specified node ids and culture. Only returns models for content that can be cast to TModel
.
public static async ValueTask<IReadOnlyList<INodeViewModel<TModel>>> ModelsAsync<TModel>(IRedaktContext context, IEnumerable<string> nodeIds, Func<TModel, bool> filter, Nullable<CultureInfo> forCulture)
- Returns:
- ValueTask<IReadOnlyList<INodeViewModel<TModel>>>
Parameters
The current IRedaktContext.
The node ids to get the view models for.
The culture for the nodes, or null to use the current request culture.
Type Parameters
The view model type. Must implement IContentType.
ModelsAsync<TModel>(IRedaktContext, IEnumerable<Link>, Func<TModel, bool>, Nullable<CultureInfo>)
Gets a list of view models for the specified node ids and culture. Only returns models for content that can be cast to TModel
.
public static async ValueTask<IReadOnlyList<INodeViewModel<TModel>>> ModelsAsync<TModel>(IRedaktContext context, IEnumerable<Link> links, Func<TModel, bool> filter, Nullable<CultureInfo> forCulture)
- Returns:
- ValueTask<IReadOnlyList<INodeViewModel<TModel>>>
Parameters
The current IRedaktContext.
The links to get the view models for.
The culture for the nodes, or null to use the current request culture.
Type Parameters
The view model type. Must implement IContentType.
ModelsAsync<TModel>(IRedaktContext, IEnumerable<IPublishedContent>, Func<TModel, bool>)
Gets a list of view models for the specified published content objects. Only returns models for content that can be cast to TModel
.
public static async ValueTask<IReadOnlyList<INodeViewModel<TModel>>> ModelsAsync<TModel>(IRedaktContext context, IEnumerable<IPublishedContent> publishedContent, Func<TModel, bool> filter)
- Returns:
- ValueTask<IReadOnlyList<INodeViewModel<TModel>>>
Parameters
The current IRedaktContext.
Collection of published content objects to get the view models for.
Type Parameters
The view model type. Must implement IContentType.