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.Common/Autofac/LifetimeScopedValue.cs

22 lines
374 B

using Autofac;
namespace Recyclarr.Common.Autofac;
public sealed class LifetimeScopedValue<T> : IDisposable
{
private readonly ILifetimeScope _scope;
public LifetimeScopedValue(ILifetimeScope scope, T value)
{
_scope = scope;
Value = value;
}
public T Value { get; }
public void Dispose()
{
_scope.Dispose();
}
}