mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
(#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:

committed by
Patrik Svensson

parent
21ac952307
commit
2f6b4f53c4
@ -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()
|
||||
|
Reference in New Issue
Block a user