ModelsAsync<TModel>(INodeViewModel, IEnumerable<Link>, Func<TModel, bool>)

Gets node view models for the specified collection of links. Only internal links that point to a valid published node of the specified model type will be returned.

public static ValueTask<IReadOnlyList<INodeViewModel<TModel>>> ModelsAsync<TModel>(INodeViewModel model, IEnumerable<Link> links, Func<TModel, bool> filter)
Returns:
ValueTask<IReadOnlyList<INodeViewModel<TModel>>>

Parameters

links IEnumerable<Link>

The links to retrieve node view models for.

filter Func<TModel, bool>

An optional filter predicate that will be applied to the result collection.

Type Parameters

TModel

The view model type of the links.

ModelsAsync<TModel>(INodeViewModel, IEnumerable<IPublishedContent>, Func<TModel, bool>)

Gets node view models for the specified collection of published content objects.

public static ValueTask<IReadOnlyList<INodeViewModel<TModel>>> ModelsAsync<TModel>(INodeViewModel model, IEnumerable<IPublishedContent> publishedContent, Func<TModel, bool> filter)
Returns:
ValueTask<IReadOnlyList<INodeViewModel<TModel>>>

Parameters

publishedContent IEnumerable<IPublishedContent>

The published content objects to retrieve node view models for.

filter Func<TModel, bool>

An optional filter predicate that will be applied to the result collection.

Type Parameters

TModel

The view model type of the content.

ModelsAsync<TModel>(INodeViewModel, IEnumerable<string>, Func<TModel, bool>)

Gets node view models for the specified collection of node ids and the current culture.

public static ValueTask<IReadOnlyList<INodeViewModel<TModel>>> ModelsAsync<TModel>(INodeViewModel model, IEnumerable<string> nodeIds, Func<TModel, bool> filter)
Returns:
ValueTask<IReadOnlyList<INodeViewModel<TModel>>>

Parameters

nodeIds IEnumerable<string>

The node ids to retrieve node view models for.

filter Func<TModel, bool>

An optional filter predicate that will be applied to the result collection.

Type Parameters

TModel

The view model type of the content.

In this article