/// <summary>
        ///     Creates a generic binding.
        /// </summary>
        /// <typeparam name="TService">The type of the service.</typeparam>
        /// <returns></returns>
        public IBindingGeneric <TService> Bind <TService>()
        {
            var bindingConfiguration = new BindingConfigurationForCode(typeof(TService));

            var binding = new BindingGeneric <TService>(this, bindingConfiguration);

            AddBinding(bindingConfiguration);
            return(binding);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="BindingImplementationGeneric{TService, TImplementation}" /> class.
 /// </summary>
 /// <param name="serviceRegistrationBuilder">The service registration builder.</param>
 /// <param name="bindingImplementationConfiguration">The binding implementation configuration.</param>
 /// <param name="serviceBinding">The service binding.</param>
 public BindingImplementationGeneric([NotNull] IServiceRegistrationBuilder serviceRegistrationBuilder,
                                     [NotNull] BindingImplementationConfigurationForCode bindingImplementationConfiguration,
                                     [NotNull] BindingGeneric <TService> serviceBinding) : base(serviceRegistrationBuilder, bindingImplementationConfiguration)
 {
     Service = serviceBinding;
 }