Пример #1
0
		public IEnumerable<IBinding> Resolve(Multimap<Type, IBinding> bindings, IRequest request)
		{
			var binding = new Binding(request.Service);
			AttachToBinding(binding, request.Service);
			binding.ScopeCallback = StandardScopeCallbacks.Singleton;
			binding.IsImplicit = true;
			return new[] { binding };
		}
Пример #2
0
		public IEnumerable<IBinding> Resolve(Multimap<Type, IBinding> bindings, IRequest request)
		{
			var binding = new Binding(request.Service);
			AttachToBinding(binding, request.Service);
			binding.ScopeCallback = request.Parameters.OfType<CreateSingletonParameter>().Any()
				? StandardScopeCallbacks.Singleton
				: StandardScopeCallbacks.Transient;

			binding.IsImplicit = true;

			return new[] { binding };
		}