Comments (6)
I'd recommend reading the content at the beginning of this thread for an explanation as to why it isn't simpler to allow a container update.
Placeholder objects aren't your only option; you can use delegate registrations, or organise your child scopes so you can change the dependencies per-scope.
from documentation.
This may tie into #99 if the Update() removal is the root issue there?
from documentation.
This issue is more specifically to write a new article to explain how to work with immutable containers. I'll leave the other issue open so this one can be separately tracked.
from documentation.
How can I add a registration to the global scope after build?
from documentation.
@StefanoVuerich; typically questions like that should be asked on Stack Overflow, rather than added as comments on existing issues.
That being said, the short answer is that, after Autofac 5.0, you cannot modify the global scope after it has been built. Child lifetime scopes can continue to have custom registrations within that scope. See https://autofaccn.readthedocs.io/en/latest/best-practices/#consider-a-container-as-immutable for some more detail.
from documentation.
@alistairjevans
After googling a bit found that PreserveExistingDefaults works.
It it really the best solution to force people add a kind of "place holder object", that can be later on overrided?
Wouldn't be simpler to let the container have the possibility to add a new registration?
from documentation.
Related Issues (20)
- log4net.rst is broken HOT 2
- Update API docs for v6 HOT 2
- Clarify delegate factory docs with more commentary
- Incorrect usage of Owned<> in per-request scope example HOT 1
- Update docs to include RegisterAssemblyOpenGenericTypes HOT 1
- Clarify which properties are auto-wired
- Service resolution algorithm should be documented HOT 4
- Potential opportunity to simplify Startup.cs config in docs' Application Integration's ASP.NET Core 3.x section HOT 3
- Additional Guidance for Custom Metadata Usage HOT 2
- Latest version as number HOT 7
- Add Azure Functions integration guide HOT 1
- Document Enhancement [Code snippet not working]
- Is the important part of the IAsyncDisposable section in the disposal.rst still true? HOT 4
- Document difference of behavior that can be observed when using MS IServiceProviderFactory vs AutofacServiceProviderFactory HOT 1
- Docs for `IConstructorSelector` optimization
- More middleware examples
- Broken links in upgrade documentation HOT 1
- Please add good getting started for single program template .NET 6 project HOT 6
- The layout seems completely broken. HOT 2
- Extend ASP.NET Core Integration documentation to reflect the parameter binding changes made in .NET 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.