public void SetValue(object newValue) { // Unity will now track and dispose this object when the request has ended. var perRequestLifetimeManager = new PerRequestLifetimeManager(); perRequestLifetimeManager.SetValue(newValue); }
public void SetValue(object newValue) { // No point in saving to http context if not disposable if (newValue is IDisposable) { var perRequestLifetimeManager = new PerRequestLifetimeManager(); perRequestLifetimeManager.SetValue(newValue); } }
public void Should_be_able_to_set_new_value() { Assert.DoesNotThrow(() => lifetimeManager.SetValue(new object())); }