c# - Why is autofac registering all instances of apicontroller instead of just the one i specify -
im having trouble understand why classes derived apicontroller registered , accessible. have 2 apicontrollers: mastercontroller : apicontroller slavecontroller : apicontroller and here how setup server container action<iappbuilder> appbuilderaction = appbuilder => { var httpconf = new httpconfiguration(); httpconf.dependencyresolver = new autofacwebapidependencyresolver(container); httpconf.routes.maphttproute("defaultapi", "api/v1/{controller}/{action}", new { action = "get" }); appbuilder.usewebapi(httpconf); }; return webapp.start(baseaddress, appbuilderaction); the problem im having when creating nunit test though try register single controller, both of them accessible during test. if register mastercontroller instance, expect url valid (master) var response = await client.getasync(new uri(http://localhost:8080, "api/v1/master/mytest...