Method ResolveViewType
ResolveViewType(Type, object)
Resolves and retrieves the registered Blazor view type for a given content type and an optional key.
Declaration
public Type ResolveViewType(Type contentType, object key = null)
Parameters
Type | Name | Description |
---|---|---|
Type | contentType | The content type associated with the desired Blazor view. This typically corresponds to a data model or ViewModel type that the view is designed to display. |
object | key | An optional key that was used during view registration. If multiple views are registered for the same content type, the key can be used to differentiate between them. |
Returns
Type | Description |
---|---|
Type | The registered Blazor view type that matches the provided content type and key. If no match is found, returns null. |
Implements
Examples
var detailViewType = repo.ResolveViewType(typeof(MyContentModel), "Detail");
var summaryViewType = repo.ResolveViewType(typeof(MyContentModel), "Summary");