Comments (6)
Also the
public interface IOptionsConfiguration<in TOptions>
{
int Order { get; }
void Setup(TOptions options);
}
should probably take void Setup(string name, TOptions options);
- I recall we talked about adding a property string Name, but it would be more flexible to let the component decide if the name applies or not
from options.
@lodejard If we didn't have a Name property on the IOptionsConfiguration, how would we filter based on Name before applying them? Is the idea that instead that the default OptionsConfiguration class would take the targetName in the constructor and only execute the action if the name matches during setup?
from options.
Yep
from options.
Updated the PR with the change to take names in Setup, can you review? #15
from options.
We ended up using a property for Name and not having the name argument from the method that applies the Action. This is the simplest design that allows deterministically executing unnamed options before matching named options for the same Order. We are keeping this item open so that we can reconsider this later, e.g. if we still believe that it is compelling to build more flexibility into the name matching logic, we should also consider providing a way to compare two instances of IOptionAction in order to sort them correctly, e.g. we could have IOptionAction implement IComparer and then OrderBy(s => s) should pick it up automatically.
from options.
from options.
Related Issues (20)
- [Annoucement][Draft] IOptionsSnapshot is now a scoped service HOT 2
- Overload Configure with access to IServiceProvider HOT 3
- Inconsistent use of null vs DefaultName HOT 1
- Extension methods for more concise registration of IConfigureOptions/IPostConfigureOptions HOT 1
- Semi-Automatic options configuration improvements HOT 7
- IConfigureOptions isn't called for authentication (named) options HOT 7
- [Question] Get Options immediately after Configure HOT 5
- Add built in support for validating options HOT 4
- Backwards Compatibility Broken with IOptionsSnapshot when upgrading to .Net Core 2.0 HOT 5
- See if we can make it easier to implement IConfigureNamedOptions HOT 2
- 1st class support for Request options HOT 4
- Add Configure<TOptions, TService1...5>(Action<TOptions>, TService1...5) overloads HOT 1
- OptionsBuilder to chain configuration calls HOT 7
- Allow collections to be replaced, when defined in IConfiguration HOT 1
- DI exception is not raised when IOptions<Poco> is not configured. HOT 2
- Call AddOptions() from Configure/AddOptions HOT 1
- IOptionsSnapshot not working in docker container using bind mount HOT 2
- Make IConfigureNamedOptions.Configure async HOT 1
- IOptionsSnapshot is not working with singleton services HOT 1
- THIS ISSUE TRACKER IS CLOSED - use the Home repo issue tracker HOT 1
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 options.