user437899
user437899

Reputation: 9269

Autofac and Web API scopes

Earlier i saw this:

.InstancePerApiRequest();

Now i only got this:

.InstancePerHttpRequest();

Did autofac removed the API-scope? I have the reference Autofac.Integration.WebApi but this extension is not available. What is the difference between InstancePerHttpRequest and InstancePerApiRequest?

Upvotes: 4

Views: 845

Answers (1)

Alex Meyer-Gleaves
Alex Meyer-Gleaves

Reputation: 3831

InstancePerApiRequest is part of the Web API integration, and InstancePerHttpRequest is part of the MVC integration. These both actually apply the same tag to the lifetime scope. That was done because you might have services that are dependencies of both Web API and MVC controllers.

Upvotes: 5

Related Questions