Beispiel #1
0
        public IDependencyRegistrar <T> WithResolvedParam <TParam>(Func <IResolutionContext, TParam> callback)
        {
            CheckValidForParameter();

            ((IRegistrationBuilder <T, ConcreteReflectionActivatorData, SingleRegistrationStyle>)_registration)
            .WithParameter(AutofacContainerBuilder.GenerateResolvedParameter(callback));
            return(this);
        }
 /// <summary>Marks the registration as having a specific constructor parameter discovered by type, whose value is resolved by the container (when given the name of the service). </summary>
 /// <typeparam name="T">The type of the service to resolve in order to pass in as the value of the parameter.</typeparam>
 /// <returns>.</returns>
 public IServiceRegistrarModifier <TContract, TImplementation> WithResolvedParam <T>(string serviceName)
 {
     _containerRegistrationBuilder.WithParameter(AutofacContainerBuilder.GenerateResolvedParameter <T>(serviceName));
     return(this);
 }
 /// <summary>Marks the registration as having a specific constructor parameter discovered by name, whose value is resolved by a callback. </summary>
 /// <typeparam name="T">The type of the service to resolve in order to pass in as the value of the parameter.</typeparam>
 /// <returns>.</returns>
 public IServiceRegistrarModifier <TContract, TImplementation> WithNamedResolvedParam <T>(string name, Func <IResolutionContext, T> callback)
 {
     _containerRegistrationBuilder.WithParameter(AutofacContainerBuilder.GenerateResolvedParameter(name, callback));
     return(this);
 }
Beispiel #4
0
 /// <summary>Marks the registration as having a specific constructor parameter discovered by type, whose value is resolved by a callback. </summary>
 /// <typeparam name="T">The type of the service to resolve in order to pass in as the value of the parameter.</typeparam>
 /// <returns>.</returns>
 public IRuntimeTypeRegistrarModifier <TContract> WithResolvedParam <T>(Func <IResolutionContext, T> callback)
 {
     _containerRegistrationBuilder.WithParameter(AutofacContainerBuilder.GenerateResolvedParameter(callback));
     return(this);
 }
Beispiel #5
0
 public IRuntimeTypeRegistrarModifier <TContract> WithNamedResolvedParam(Type paramType, string name, Func <IResolutionContext, object> callback)
 {
     _containerRegistrationBuilder.WithParameter(AutofacContainerBuilder.GenerateResolvedParameter(paramType, name, callback));
     return(this);
 }
Beispiel #6
0
 public IRuntimeTypeRegistrarModifier <TContract> WithResolvedParam(Type paramType, string serviceName)
 {
     _containerRegistrationBuilder.WithParameter(AutofacContainerBuilder.GenerateResolvedParameter(paramType, serviceName));
     return(this);
 }