Removing Autofac dependency \ tests from ControllersFromServicesWebSite

This commit is contained in:
Pranav K 2015-08-04 15:50:10 -07:00
parent 5d4c684758
commit 018e803dc1
2 changed files with 3 additions and 25 deletions

View File

@ -3,14 +3,9 @@
using System;
using System.Reflection;
using ControllersFromServicesClassLibrary;
using Microsoft.AspNet.Builder;
using Microsoft.Framework.DependencyInjection;
using ControllersFromServicesClassLibrary;
#if DNX451
using Autofac;
using Microsoft.Framework.DependencyInjection.Autofac;
#endif
namespace ControllersFromServicesWebSite
{
@ -28,20 +23,7 @@ namespace ControllersFromServicesWebSite
services.AddTransient<QueryValueService>();
#if DNX451
// Create the autofac container
var builder = new ContainerBuilder();
// Create the container and use the default application services as a fallback
AutofacRegistration.Populate(
builder,
services);
return builder.Build()
.Resolve<IServiceProvider>();
#else
return services.BuildServiceProvider();
#endif
}
public void Configure(IApplicationBuilder app)

View File

@ -4,7 +4,7 @@
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5000"
},
"dependencies": {
"ControllersFromServicesClassLibrary": "1.0.0",
"ControllersFromServicesClassLibrary": "1.0.0",
"Kestrel": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
@ -13,11 +13,7 @@
"Microsoft.AspNet.StaticFiles": "1.0.0-*"
},
"frameworks": {
"dnx451": {
"dependencies": {
"Microsoft.Framework.DependencyInjection.Autofac": "1.0.0-*"
}
},
"dnx451": {},
"dnxcore50": { }
},
"webroot": "wwwroot"