James Kraus
James Kraus

Reputation: 3478

Programatically getting the model types for a bunch of views

I'm looking to get the interfaces required for a bunch of views we have scattered across a number of projects. Is there a good way to retrieve the model/interface required for a given razor template/view? They all begin with something like:

@inherits Our.Custom.TypeOfView<IModel>

Where TypeOfView is a class that inherits from System.Web.Mvc.WebViewPage.

I could potentially do some string searching through all the files, but it feels like there is probably a better way to directly get the information I'm interested in. Maybe there isn't? I don't know, that's why I'm asking this question.

Upvotes: 0

Views: 35

Answers (1)

Related Questions