protected override object ResolveCore(CreationContext context, bool track, bool instanceRequired)
{
Type implType;
try
{
implType = ComponentModel.Implementation.MakeGenericType(context.GenericArguments);
}
catch (ArgumentException)
{
// may throw in some cases when impl has generic constraints that service hasn't
if(instanceRequired)
{
throw;
}
return null;
}
var handler = GetSubHandler(context, implType);
// so the generic version wouldn't be considered as well
using(context.EnterResolutionContext(this, false))
{
return handler.Resolve(context);
}
}