[C# .NET6] AutoFac ADD implementation after DI Container Resolve


If you want to Add a implementation after DI Container resolved already,
you need to create a newBuilder and Update it to the original Container.

                var newBuilder = new ContainerBuilder();
                newBuilder.Register(c =>  new Car {Seats = GetSeats().Split(',') }).As<ICar>();
                newBuilder.Update(OriginalDIContainer);
#C# #.net6 #.net






你可能感興趣的文章

【譯】Tokio 內部機制:從頭理解 Rust 非同步 I/O 框架

【譯】Tokio 內部機制:從頭理解 Rust 非同步 I/O 框架

Filecoin Spec 中文 -- 1

Filecoin Spec 中文 -- 1

一個資淺工程師年末的自我省視

一個資淺工程師年末的自我省視






留言討論