//The class is defined like so....
public class CreateNewAccountHandler : ICommandHandler<CreateNewAccountCommand, CreateNewAccountResponse>
{
public CreateNewAccountResponse ExecuteCommand(CreateNewAccountCommand command)
{
throw new NotImplementedException();
}
}
//And here it the code which won't compile
static void RegisterHandlers_Account(IUnityContainer unityContainer)
{
unityContainer.RegisterType
<
ICommandHandler
<
TaskSmart.AppLayer.Api.Commands.Account.CreateNewAccountCommand,
TaskSmart.AppLayer.Api.Commands.Account.CreateNewAccountResponse
>,
TaskSmart.AppLayer.RequestHandlers.Account.CreateNewAccountHandler
>(new TransientLifetimeManager());
}
Error 1 The type 'TaskSmart.AppLayer.RequestHandlers.Account.CreateNewAccountHandler' cannot be used as type parameter 'TTo' in the generic type or method 'Microsoft.Practices.Unity.IUnityContainer.RegisterType(Microsoft.Practices.Unity.LifetimeManager, params Microsoft.Practices.Unity.InjectionMember[])'. There is no implicit reference conversion from 'TaskSmart.AppLayer.RequestHandlers.Account.CreateNewAccountHandler' to 'TaskSmart.AppLayer.Api.RequestHandlers.ICommandHandler'. C:\Data\TaskSmart\TaskSmart.AppLayer\UnityBootStrapper.cs 50 6 TaskSmart.AppLayer
I have checked it many times, but I just cannot see why this refuses to compile! I've even fully qualified the class/interface names to ensure it is not a namespace problem and I get the same error.
Any ideas?
PS: SVN is here: https://tasksmart.svn.sourceforge.net/svnroot/tasksmart/trunk