/// <summary> /// Initializes a new instance of the <see cref="Binding" /> class. /// </summary> /// <param name="service">The service that is controlled by the binding.</param> public Binding(Type service) { Ensure.ArgumentNotNull(service, "service"); Service = service; BindingConfiguration = new BindingConfiguration(); }
/// <summary> /// Initializes a new instance of the <see cref="Binding" /> class. /// </summary> /// <param name="service">The service that is controlled by the binding.</param> public Binding(Type service) { Ensure.ArgumentNotNull(service, "service"); Service = service; BindingConfiguration = new BindingConfiguration(); }
/// <summary> /// Gets the scope for the binding, if any. /// </summary> /// <param name="context">The context.</param> /// <returns> /// The object that will act as the scope, or <see langword="null" /> if the service is transient. /// </returns> public object GetScope(IContext context) { return(BindingConfiguration.GetScope(context)); }
/// <summary> /// Determines whether the specified request satisfies the condition defined on the binding, /// if one was defined. /// </summary> /// <param name="request">The request.</param> /// <returns> /// <c>True</c> if the request satisfies the condition; otherwise <c>false</c>. /// </returns> public bool Matches(IRequest request) { return(BindingConfiguration.Matches(request)); }
/// <summary> /// Gets the provider for the binding. /// </summary> /// <param name="context">The context.</param> /// <returns>The provider to use.</returns> public IProvider GetProvider(IContext context) { return(BindingConfiguration.GetProvider(context)); }