@using HtmlGenerationWebSite.Models
@using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
@model ViewModel
@{
    var metadata = ViewData.ModelMetadata;
}

<h5>Template for ViewModel</h5>
<div class="col-md-3">MetadataKind: '@metadata.MetadataKind'</div>
<div class="col-md-3">ModelType: '@metadata.ModelType.Name'</div>
@if (metadata.MetadataKind == ModelMetadataKind.Property)
{
    <div class="col-md-3">PropertyName: '@metadata.PropertyName'</div>
}