Exemplo n.º 1
0
        private object InnerGet(Type expectType, bool autoResolving, params object[] lastMappingValues)
        {
            if (expectType == null)
            {
                throw new ArgumentNullException(nameof(expectType));
            }

            using (GA.Locking(this.UUID + expectType.AssemblyQualifiedName))
            {
                var callSite = GetCallSite(this, expectType);
                if (callSite == null && autoResolving)
                {
                    callSite = this.AutoResolving(expectType, null);
                    if (callSite == null)
                    {
                        return(null);
                    }
                    CacheType.TryAdd(expectType, new List <ICallSite>(1)
                    {
                        callSite
                    });
                }
                return(callSite?.Invoke(lastMappingValues));
            }
        }