I have the following piece of code
public TOutput DoStuff<TOutput>(object input)
{
var type = typeof(IDoStuffHandler<,>).MakeGenericType(typeof(TOutput), input.GetType());
dynamic provider = _lifetimeScope.Resolve(type);
return provider.DoStuff((dynamic)input);
}
This currently works as long as the input is not null. As soon as we have a null I get a null reference exception on input.GetType(). Is there a way for me to figure out the type of input?