Register string value for concrete name of parameter
I am using Autofac and I have several classes which ask for parameter of type string and name lang. Is there a way to register a string value to all parameters named "lang", so it resolves automatically? I do not want to edit any of the constructors, since it is not my code (I know accepting e.g. CultureInfo would make registration easy..) Something resulting in short syntax like builder.Register(lang => "en-US").As().Named("lang") would be ideal. Thank you. A fairly simple way to solve this is with a custom Autofac module. First, implement the module and handle the IComponentRegistration