Search code examples
genericsasp.net-mvc-3razor

Using a generic model in ASP.NET MVC Razor


Is it possible to use a generic model in ASP.NET MVC 3 (w/ Razor)? The following fails with a syntax error:

@model DtoViewModel<T> where T : IDto

Solution

  • Such syntax is not supported by Razor, sorry.