You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/src/Recyclarr.Cli/Console/Helpers/AutofacTypeResolver.cs

20 lines
392 B

using Autofac;
using Spectre.Console.Cli;
namespace Recyclarr.Cli.Console.Helpers;
internal class AutofacTypeResolver : ITypeResolver
{
private readonly ILifetimeScope _scope;
public AutofacTypeResolver(ILifetimeScope scope)
{
_scope = scope;
}
public object? Resolve(Type? type)
{
return type is not null ? _scope.Resolve(type) : null;
}
}