This repository was archived by the owner on Nov 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Add Options<T> #106
Comments
Would this would be instead of the old pattern of MyOptions implementing |
Yep! It's something @PinpointTownes suggested #105 (comment). |
I updated the sample in B to show the usage. |
davidfowl
added a commit
that referenced
this issue
Jan 5, 2016
- Useful for passing poco TOptions to APIs that take IOptions<TOptions> #106
Ok yeah that looks much better, it was pretty gross making everything implement IOptions before... Maybe we should name the generic Options class OptionsWrapper so people don't think its a base class...which is what the name implies... |
PR out for review. |
Do we want to consider an overload of |
Hmmmmmmmm |
app.UseFoo(Options.Create(options =>
{
options.Value = 10;
}); var options = Options.Create(opt =>
{
opt.Value = 10;
});
app.UseFoo(options); |
Yeah well this way you give people the option to do either one, so everyone is happy |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Would act as an
IOptions<T>
wrapper for some T. Would make a convenient way to create anIOptions<T>
from any T. We could also have a factory method (/cc @divega) that makes one of these from a T i.e.IOptions<T> Options.Create<T>(T options)
.The text was updated successfully, but these errors were encountered: