Skip to content

Commit e27868b

Browse files
author
Chris Santero
committed
make sure TodoMVC sample works.
1 parent 2963d60 commit e27868b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

JSONAPI.TodoMVC.API/Startup.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
using System.Web.Http;
1+
using System.Data.Entity;
2+
using System.Reflection;
3+
using System.Web.Http;
24
using Autofac;
5+
using Autofac.Integration.WebApi;
36
using JSONAPI.Autofac;
47
using JSONAPI.Autofac.EntityFramework;
58
using JSONAPI.Core;
@@ -35,6 +38,9 @@ private static HttpConfiguration GetWebApiConfiguration()
3538
containerBuilder.RegisterModule(efModule);
3639
containerBuilder.RegisterGeneric(typeof(EntityFrameworkDocumentMaterializer<>))
3740
.AsImplementedInterfaces();
41+
containerBuilder.RegisterApiControllers(Assembly.GetExecutingAssembly());
42+
containerBuilder.RegisterType<TodoMvcContext>().As<DbContext>();
43+
3844
var container = containerBuilder.Build();
3945
httpConfig.UseJsonApiWithAutofac(container);
4046

0 commit comments

Comments
 (0)