PerRequestLifetimeManager.SetValue C# (CSharp) Method

SetValue() public method

public SetValue ( object newValue ) : void
newValue object
return void
        public override void SetValue(object newValue)
        {
            if (HttpContext.Current != null)
                HttpContext.Current.Items[key] = newValue;
        }

Usage Example

Beispiel #1
0
    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);
    }
All Usage Examples Of PerRequestLifetimeManager::SetValue
PerRequestLifetimeManager