コード例 #1
0
ファイル: NSubContainer.cs プロジェクト: zvirja/NSubstitute
            public object Resolve(Type type)
            {
                // The same lock object is shared among all the nested containers,
                // so we synchronize across the whole containers graph.
                lock (_mostNestedContainer._syncRoot)
                {
                    Registration?registration = _mostNestedContainer.TryFindRegistration(type);
                    if (registration == null)
                    {
                        throw new InvalidOperationException($"Type is not registered: {type.FullName}");
                    }

                    return(registration.Resolve(this));
                }
            }