{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/Options/issues/78","labels_url":"https://api.github.com/repos/aspnet/Options/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Options/issues/78/comments","events_url":"https://api.github.com/repos/aspnet/Options/issues/78/events","html_url":"https://github.com/aspnet/Options/issues/78","id":98491584,"number":78,"title":"Review all middleware options usage","user":{"login":"HaoK","id":6537861,"avatar_url":"https://avatars.githubusercontent.com/u/6537861?v=3","gravatar_id":"","url":"https://api.github.com/users/HaoK","html_url":"https://github.com/HaoK","followers_url":"https://api.github.com/users/HaoK/followers","following_url":"https://api.github.com/users/HaoK/following{/other_user}","gists_url":"https://api.github.com/users/HaoK/gists{/gist_id}","starred_url":"https://api.github.com/users/HaoK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaoK/subscriptions","organizations_url":"https://api.github.com/users/HaoK/orgs","repos_url":"https://api.github.com/users/HaoK/repos","events_url":"https://api.github.com/users/HaoK/events{/privacy}","received_events_url":"https://api.github.com/users/HaoK/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-01T00:07:05Z","updated_at":"2015-10-16T22:13:39Z","closed_at":"2015-10-16T22:13:39Z","body":"I think we are pretty close to having the consistent pattern for options usage in middlewares from the discussion last week:\r\n\r\n1. All middleware should take `IOptions<TOptions>` instead of directly taking an instance of TOptions\r\n2. UseMiddleware should have the follow two overloads:\r\n\r\n ``` C# \r\nUseXyz(options => options.Whatever = \"yar\") // use shared options from DI, and apply action to tweak\r\nUseXyz(new TOptions() { Whaterver = \"yar\" }) // forget about what's in DI, just use this instance\r\n ```\r\n3. Introduce a new abstract `Options<TOptions>` base class that implements `IOptions<TOptions>` by simply returning this, that all the framework options can dervice from to easily get this behavior for free.\r\n\r\nI can make a pass through all the repos to make things consistent assuming we all agree that this what we want...\r\n\r\nThoughts @divega @lodejard @davidfowl ?\r\n"}}