Exemplo n.º 1
0
 /// <summary>
 /// Initializes a default instance of the <see cref="DefaultFilesMiddleware"/> class.
 /// </summary>
 public DefaultFilesMiddleware()
 {
     _options = new DefaultFilesOptions();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Enables static file serving for the current request path.
        /// </summary>
        /// <param name="server">The <see cref="IApplicationBuilder"/> instance this method extends.</param>
        /// <param name="options">The <see cref="DefaultFilesMiddleware"/> used to configure the middleware.</param>
        public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder server, DefaultFilesOptions options)
        {
            if (server == null)
            {
                throw new ArgumentNullException(nameof(server));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(server.UseMiddleware(typeof(DefaultFilesMiddleware), options));
        }