1

Closed

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

description

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

comments

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.

Matthew