Nullable<> as TModel for ViewPage

Posted by Alexander Prokofyev on Stack Overflow See other posts from Stack Overflow or by Alexander Prokofyev
Published on 2009-06-18T11:52:20Z Indexed on 2010/04/07 2:43 UTC
Read the original article Hit count: 400

What are the possible reasons what Nullable<> types are disallowed to be passed as TModel parameter of System.Web.Mvc.ViewPage<TModel> generic? This could be handy sometimes.

In ASP.NET MVC source defined what TModel should be a class:

public class ViewPage<TModel> : ViewPage where TModel : class

but Nullable types are value types. Maybe definition could be less restrictive...

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about view-model