Ninject.Activation.Caching.Cache.TryGet C# (CSharp) Méthode

TryGet() public méthode

Tries to retrieve an instance to re-use in the specified context.
public TryGet ( IContext context ) : object
context IContext The context that is being activated.
Résultat object
        public object TryGet(IContext context)
        {
            Ensure.ArgumentNotNull(context, "context");

            var scope = context.GetScope();

            #if !NO_WEB
            var httpScope = scope as HttpContext;
            if(httpScope != null)
            {
                var entries = GetEntriesCache(httpScope);
                return GetItemFromCache(context, httpScope, entries);
            }
            #endif
            lock (_entries)
            {
                return GetItemFromCache(context, scope, _entries);
            }
        }