// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Options.Infrastructure;
namespace Microsoft.AspNetCore
{
///
/// Exposes extension method for establishing configuration defaults.
///
public static class AspNetCoreExtensions
{
///
/// Allows features to do some default setup for their options, i.e. binding against the default configuration.
///
/// The to modify.
/// The service collection.
public static IServiceCollection ConfigureAspNetCoreDefaults(this IServiceCollection services)
{
services.AddTransient(typeof(IConfigureOptions<>), typeof(ConfigureDefaults<>));
services.AddTransient(typeof(IConfigureNamedOptions<>), typeof(ConfigureDefaults<>));
return services;
}
}
}