[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






你可能感興趣的文章

1 認識元件

1 認識元件

[Python Excel自動化1]以VBA運行Python操作Excel

[Python Excel自動化1]以VBA運行Python操作Excel

[C#] .net framework 使用 Autofac 註冊多組資料庫連線

[C#] .net framework 使用 Autofac 註冊多組資料庫連線






留言討論