When you register a reflection-based component, the constructor of the type may require a parameter that can’t be resolved from the container. You can use a parameter on the registration to provide that value.

Say you have a configuration reader that needs a configuration section name passed in:

// Using a NAMED parameter:builder.RegisterType<ConfigReader>().As<IConfigReader>().WithParameter("configSectionName","sectionName");// Using a TYPED parameter:builder.RegisterType<ConfigReader>().As<IConfigReader>().WithParameter(newTypedParameter(typeof(string),"sectionName"));// Using a RESOLVED parameter:builder.RegisterType<ConfigReader>().As<IConfigReader>().WithParameter(newResolvedParameter((pi,ctx)=>pi.ParameterType==typeof(string)&&pi.Name=="configSectionName",(pi,ctx)=>"sectionName"));

With lambda expression component registrations, rather than passing the parameter value at registration time you enable the ability to pass the value at service resolution time. (Read more about resolving with parameters.)

In the component registration expression, you can make use of the incoming parameters by changing the delegate signature you use for registration. Instead of just taking in an IComponentContext parameter, take in an IComponentContext and an IEnumerable<Parameter>:

// Use TWO parameters to the registration delegate:// c = The current IComponentContext to dynamically resolve dependencies// p = An IEnumerable<Parameter> with the incoming parameter setbuilder.Register((c,p)=>newConfigReader(p.Named<string>("configSectionName"))).As<IConfigReader>();