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


Nov 22, 2022

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






你可能感興趣的文章

#STM32與sensor開發紀錄

#STM32與sensor開發紀錄

AI輔導室|拒絕再畫傻瓜雙框線

AI輔導室|拒絕再畫傻瓜雙框線

Deep Learning on 3D object detection paper 閱讀路徑

Deep Learning on 3D object detection paper 閱讀路徑






留言討論






2
2
2