/// <summary>
        /// Adds the <see cref="RequestLocalizationMiddleware"/> to automatically set culture information for
        /// requests based on information provided by the client.
        /// </summary>
        /// <param name="app">The <see cref="IAppBuilder"/>.</param>
        /// <param name="options">The <see cref="RequestLocalizationOptions"/> to configure the middleware with.</param>
        /// <returns>The <see cref="IAppBuilder"/>.</returns>
        public static IAppBuilder UseRequestLocalization(this IAppBuilder app, RequestLocalizationOptions options)
        {
            if (app == null)
            {
                throw new ArgumentNullException("app");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            return app.Use<RequestLocalizationMiddleware>(Options.Create(options));
        }
 public RequestLocalizationMiddleware(OwinMiddleware next, IOptions<RequestLocalizationOptions> options) : base(next)
 {
     this.Options = options.Value;
 }