We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2963d60 commit e27868bCopy full SHA for e27868b
1 file changed
JSONAPI.TodoMVC.API/Startup.cs
@@ -1,5 +1,8 @@
1
-using System.Web.Http;
+using System.Data.Entity;
2
+using System.Reflection;
3
+using System.Web.Http;
4
using Autofac;
5
+using Autofac.Integration.WebApi;
6
using JSONAPI.Autofac;
7
using JSONAPI.Autofac.EntityFramework;
8
using JSONAPI.Core;
@@ -35,6 +38,9 @@ private static HttpConfiguration GetWebApiConfiguration()
35
38
containerBuilder.RegisterModule(efModule);
36
39
containerBuilder.RegisterGeneric(typeof(EntityFrameworkDocumentMaterializer<>))
37
40
.AsImplementedInterfaces();
41
+ containerBuilder.RegisterApiControllers(Assembly.GetExecutingAssembly());
42
+ containerBuilder.RegisterType<TodoMvcContext>().As<DbContext>();
43
+
44
var container = containerBuilder.Build();
45
httpConfig.UseJsonApiWithAutofac(container);
46
0 commit comments