(In response to comments above...)
Just use the property on the nested model. For a single instance, it would be something like this:
@Html.DisplayNameFor(model => model.SomeLicense.SomeProperty)
For a collection of instances, where the parent model has a collection of the nested model, you can refer to an instance in the collection:
@Html.DisplayNameFor(model => model.SomeLicenses.First().SomeProperty)
It may appear that the call to First()
could fail in the event that there are zero elements, but it never actually invokes First()
in this case. The reference itself is just used by the framework for what I might call "some reflection trickery" to get type information so it can reference the attributes on that property.