builder.RegisterType().As ().InstancePerDependency();
builder.RegisterType() .As () .WithParameter( new TypedParameter(typeof(string), "hello")) .InstancePerLifetimeScope();
builder.RegisterTypeThis code registers a component named MyComponent as an implementation of the IMyComponent interface. It is registered as a singleton instance within a specific lifetime scope. It also has associated metadata with a key of "Category" and a value of "Foo". Overall, IComponentRegistration is a key interface in the Autofac library that allows for flexible registration of components with metadata, parameters, and scoping rules.() .As () .WithMetadata("Category", "Foo") .InstancePerLifetimeScope();