ModelAsync<TModel>(INodeViewModel, Link)
Gets the node view model for the specified link. Only internal links that point to a valid published node of the specified model type will be returned.
public static ValueTask<INodeViewModel<TModel>> ModelAsync<TModel>(INodeViewModel model, Link link)
- Returns:
- ValueTask<INodeViewModel<TModel>>
Parameters
Type Parameters
TModel
The view model type of the link.
ModelAsync<TModel>(INodeViewModel, IPublishedContent)
Gets the node view model for the specified published content object. Returns null if the content cannot be case to TModel
.
public static ValueTask<INodeViewModel<TModel>> ModelAsync<TModel>(INodeViewModel model, IPublishedContent publishedContent)
- Returns:
- ValueTask<INodeViewModel<TModel>>
Parameters
model
INodeViewModel
publishedContent
IPublishedContent
The published content object to retrieve the node view model for.
Type Parameters
TModel
The view model type of the content.
ModelAsync<TModel>(INodeViewModel, string)
Gets the node view model for the specified node id and the current culture. Returns null if the content cannot be found or cast to TModel
.
public static ValueTask<INodeViewModel<TModel>> ModelAsync<TModel>(INodeViewModel model, string nodeId)
- Returns:
- ValueTask<INodeViewModel<TModel>>
Parameters
Type Parameters
TModel
The view model type of the content.