From 8695da085be21a6f524faba2435d8dd86210ab0d Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 15 May 2014 16:24:39 -0700 Subject: [PATCH] Add IOptionsAccessor as a default service --- src/Microsoft.AspNet.Hosting/HostingServices.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Microsoft.AspNet.Hosting/HostingServices.cs b/src/Microsoft.AspNet.Hosting/HostingServices.cs index c7376cd52e..5403f190fb 100644 --- a/src/Microsoft.AspNet.Hosting/HostingServices.cs +++ b/src/Microsoft.AspNet.Hosting/HostingServices.cs @@ -59,6 +59,14 @@ namespace Microsoft.AspNet.Hosting Lifecycle = LifecycleKind.Scoped }; + // TODO: Review whether this is the right long term home, and whether Scoped is correct lifetime + yield return new ServiceDescriptor + { + ServiceType = typeof(IOptionsAccessor<>), + ImplementationType = typeof(OptionsAccessor<>), + Lifecycle = LifecycleKind.Scoped + }; + if (PlatformHelper.IsMono) { #if NET45