when use Resolve<T> method ,why T should be a class


public TType Resolve<TType>() where TType : class;
Closed Mar 9, 2012 at 7:49 PM by mdennis
Not an issue, should be in Discussions


zsbfree wrote Nov 7, 2011 at 8:02 AM

I found all method has the TType:class ....but why we need it

mdennis wrote Mar 9, 2012 at 6:53 PM

This is a question for the Discussions, not an Issue.

The reason is that in order to resolve TType, there needs to be a constructor. Only classes have constructors. Value objects such as int, string, ... do not.


wrote Mar 9, 2012 at 7:49 PM

wrote Feb 14, 2013 at 4:01 AM

wrote May 16, 2013 at 9:57 AM