Skip to content

Instantly share code, notes, and snippets.

View tboby's full-sized avatar

Thomas Boby tboby

  • Oxford, UK
  • 07:16 (UTC +01:00)
View GitHub Profile
@joeriks
joeriks / ArticlePageViewModel.cs
Last active March 8, 2021 08:14
PartialFor - resolve name of partial from type name or from UIHint (like DisplayFor)
public class ArticlePageViewModel {
// use partial view "TopMenuViewModel.cshtml"
public TopMenuViewModel TopMenu {get;set;}
// use partial view "WidgetsViewModel.cshtml"
public WidgetsViewModel Widgets {get;set;}
// use partial view "ExtraWidgets.cshtml"
[UIHint("ExtraWidgets")]