(#555) Clarify ITypeResolver returns null

and does not throw on unresolvable types.
Also changed the TypeResolverAdapter to adhere
to those expectations and removed the now no longer
needed try-catch from CommandPropertyBinder.
This commit is contained in:
Nils Andresen
2021-11-13 21:27:10 +01:00
committed by Patrik Svensson
parent 21ac952307
commit 2f6b4f53c4
4 changed files with 11 additions and 18 deletions

View File

@ -15,7 +15,12 @@ namespace Spectre.Console.Examples
public object Resolve(Type type)
{
return _provider.GetRequiredService(type);
if (type == null)
{
return null;
}
return _provider.GetService(type);
}
public void Dispose()