コード例 #1
0
        public static Action <Func <IServiceProvider, Tuple <Type, object> > > GetRuntimeRegistrationDelegate(
            this IDictionary <string, object> environment)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }

            PerRequestContainerTuple perRequestContainerTuple =
                environment[Constants.OwinRequestContainerEnvironmentKey] as PerRequestContainerTuple;

            return(perRequestContainerTuple != null
                ? perRequestContainerTuple.Item2
                : null);
        }
コード例 #2
0
        public static IServiceProvider GetRequestContainer(
            this IDictionary <string, object> environment)
        {
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }

            PerRequestContainerTuple perRequestContainerTuple =
                environment[Constants.OwinRequestContainerEnvironmentKey] as PerRequestContainerTuple;

            return(perRequestContainerTuple != null
                ? perRequestContainerTuple.Item1
                : null);
        }