Removing Autofac dependency \ tests from ControllersFromServicesWebSite
This commit is contained in:
parent
5d4c684758
commit
018e803dc1
|
|
@ -3,14 +3,9 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using ControllersFromServicesClassLibrary;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.Framework.DependencyInjection;
|
using Microsoft.Framework.DependencyInjection;
|
||||||
using ControllersFromServicesClassLibrary;
|
|
||||||
|
|
||||||
#if DNX451
|
|
||||||
using Autofac;
|
|
||||||
using Microsoft.Framework.DependencyInjection.Autofac;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace ControllersFromServicesWebSite
|
namespace ControllersFromServicesWebSite
|
||||||
{
|
{
|
||||||
|
|
@ -28,20 +23,7 @@ namespace ControllersFromServicesWebSite
|
||||||
|
|
||||||
services.AddTransient<QueryValueService>();
|
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();
|
return services.BuildServiceProvider();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app)
|
public void Configure(IApplicationBuilder app)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5000"
|
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5000"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ControllersFromServicesClassLibrary": "1.0.0",
|
"ControllersFromServicesClassLibrary": "1.0.0",
|
||||||
"Kestrel": "1.0.0-*",
|
"Kestrel": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
"Microsoft.AspNet.Mvc": "6.0.0-*",
|
||||||
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
|
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
|
||||||
|
|
@ -13,11 +13,7 @@
|
||||||
"Microsoft.AspNet.StaticFiles": "1.0.0-*"
|
"Microsoft.AspNet.StaticFiles": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnx451": {
|
"dnx451": {},
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.Framework.DependencyInjection.Autofac": "1.0.0-*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dnxcore50": { }
|
"dnxcore50": { }
|
||||||
},
|
},
|
||||||
"webroot": "wwwroot"
|
"webroot": "wwwroot"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue