示例#1
0
        internal IEnumerable <FieldInfo> GetFields(Type type)
        {
            if (!_typeToFields.TryGetValue(type, out var enumerable))
            {
                enumerable          = BindingHelper.GetInjectableFields(type);
                _typeToFields[type] = enumerable;
            }

            return(enumerable);
        }
示例#2
0
        public IBindingScopeOnResolve AsTransient()
        {
            Resolution = BindingResolution.AsTransient;

            var currentBinding = _container.CurrentBinding;

            _container.ThrowIfHasNoPendingBinding();
            _container.CurrentBinding = null;
            _container.Bind(BindingHelper.CreateIFactoryType(ServiceType)).ToConstant(BindingHelper.CreateFactoryObject(ImplementationType, _container)).AsCached().OnRequest();
            _container.ThrowIfHasPendingBinding();

            _container.CurrentBinding = currentBinding;

            return(this);
        }