public bool TryResolveDummyValue(DummyCreationSession session, Type typeOfDummy, out object result)
        {
            result = default(object);
            if (!session.TryBeginToResolveType(typeOfDummy))
            {
                return(false);
            }

            if (this.TryResolveDummyValueWithAllAvailableStrategies(session, typeOfDummy, out result))
            {
                session.OnSuccessfulResolve(typeOfDummy);
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public CreationResult TryResolveDummyValue(DummyCreationSession session, Type typeOfDummy)
        {
            if (!session.TryBeginToResolveType(typeOfDummy))
            {
                return(CreationResult.FailedToCreateDummy(typeOfDummy, "Recursive dependency detected. Already resolving " + typeOfDummy + '.'));
            }

            var creationResult = this.TryResolveDummyValueWithAllAvailableStrategies(session, typeOfDummy);

            if (creationResult.WasSuccessful)
            {
                session.OnSuccessfulResolve(typeOfDummy);
            }

            return(creationResult);
        }