diff --git a/src/Microsoft.AspNet.Authorization/ServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Authorization/ServiceCollectionExtensions.cs index 9146c747b9..292083120b 100644 --- a/src/Microsoft.AspNet.Authorization/ServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Authorization/ServiceCollectionExtensions.cs @@ -22,12 +22,11 @@ namespace Microsoft.Framework.DependencyInjection // Review: Need UseDefaultSubkey parameter? public static IServiceCollection AddAuthorization([NotNull] this IServiceCollection services, IConfiguration config = null, Action configureOptions = null) { - var describe = new ServiceDescriber(config); - services.AddOptions(config); - services.TryAdd(describe.Transient()); - services.Add(describe.Transient()); - services.Add(describe.Transient()); - services.Add(describe.Transient()); + services.AddOptions(); + services.TryAdd(ServiceDescriptor.Transient()); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); if (configureOptions != null) { services.Configure(configureOptions); diff --git a/test/Microsoft.AspNet.Authorization.Test/DefaultAuthorizationServiceTests.cs b/test/Microsoft.AspNet.Authorization.Test/DefaultAuthorizationServiceTests.cs index 54a4e1a7c8..4b9b5a33de 100644 --- a/test/Microsoft.AspNet.Authorization.Test/DefaultAuthorizationServiceTests.cs +++ b/test/Microsoft.AspNet.Authorization.Test/DefaultAuthorizationServiceTests.cs @@ -7,7 +7,6 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Xunit; namespace Microsoft.AspNet.Authorization.Test