Autofac.WebApi2.Owin
6.2.0
Prefix Reserved
See the version list below for details.
dotnet add package Autofac.WebApi2.Owin --version 6.2.0
NuGet\Install-Package Autofac.WebApi2.Owin -Version 6.2.0
<PackageReference Include="Autofac.WebApi2.Owin" Version="6.2.0" />
<PackageVersion Include="Autofac.WebApi2.Owin" Version="6.2.0" />
<PackageReference Include="Autofac.WebApi2.Owin" />
paket add Autofac.WebApi2.Owin --version 6.2.0
#r "nuget: Autofac.WebApi2.Owin, 6.2.0"
#addin nuget:?package=Autofac.WebApi2.Owin&version=6.2.0
#tool nuget:?package=Autofac.WebApi2.Owin&version=6.2.0
Autofac.WebApi.Owin
OWIN support for the ASP.NET Web API integration for Autofac.
Please file issues and pull requests for this package in this repository rather than in the Autofac core repo.
Quick Start
If you are using Web API as part of an OWIN application, you need to:
- Do all the stuff for standard Web API integration - register controllers, set the dependency resolver, etc.
- Set up your app with the base Autofac OWIN integration.
- Add a reference to the
Autofac.WebApi2.Owin
NuGet package. - In your application startup class, register the Autofac Web API middleware after registering the base Autofac middleware.
public class Startup
{
public void Configuration(IAppBuilder app)
{
var builder = new ContainerBuilder();
// STANDARD WEB API SETUP:
// Get your HttpConfiguration. In OWIN, you'll create one
// rather than using GlobalConfiguration.
var config = new HttpConfiguration();
// Register your Web API controllers.
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
// Run other optional steps, like registering filters,
// per-controller-type services, etc., then set the dependency resolver
// to be Autofac.
var container = builder.Build();
config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
// OWIN WEB API SETUP:
// Register the Autofac middleware FIRST, then the Autofac Web API middleware,
// and finally the standard Web API middleware.
app.UseAutofacMiddleware(container);
app.UseAutofacWebApi(config);
app.UseWebApi(config);
}
}
A common error in OWIN integration is use of the GlobalConfiguration.Configuration
. In OWIN you create the configuration from scratch. You should not reference GlobalConfiguration.Configuration
anywhere when using the OWIN integration.
Check out the documentation for more usage details.
Get Help
Need help with Autofac? We have a documentation site as well as API documentation. We're ready to answer your questions on Stack Overflow or check out the discussion forum.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Autofac (>= 6.5.0)
- Autofac.Owin (>= 7.1.0)
- Autofac.WebApi2 (>= 6.1.1)
- Microsoft.AspNet.WebApi.Owin (>= 5.2.9)
- System.Net.Http (>= 4.3.4)
NuGet packages (22)
Showing the top 5 NuGet packages that depend on Autofac.WebApi2.Owin:
Package | Downloads |
---|---|
BumperLane.Tenant.Api.Framework
Framework for BumperLane API sites |
|
TouchConvert.Tenant.Api.V1.Dtos
Data transfer objects for TouchConvert version one APIs. |
|
TouchConvert.Tenant.Api.V2.Dtos
Data transfer objects for TouchConvert version two APIs. |
|
Dywham.Middleware.Endpoints.WebApi
Description |
|
Bit.Server.WebApi
Bit.Server.WebApi |
GitHub repositories (10)
Showing the top 10 popular GitHub repositories that depend on Autofac.WebApi2.Owin:
Repository | Stars |
---|---|
openiddict/openiddict-core
Flexible and versatile OAuth 2.0/OpenID Connect stack for .NET
|
|
ivaylokenov/MyTested.WebApi
Fluent testing framework for ASP.NET Web API 2.
|
|
autofac/Examples
Example projects that consume and demonstrate Autofac IoC functionality and integration
|
|
microsoft/Appsample-Photosharing
Sample code for a UWP photo sharing app.
|
|
daxnet/we-text
WeText is a sample application that demonstrates the implementation of DDD/CQRS and microservice architectural patterns in C#.
|
|
Azure/azure-iot-remote-monitoring
Azure IoT Remote Monitoring preconfigured solution
|
|
stoveproject/Stove
Domain Driven Design oriented application framework, meets CRUD needs
|
|
ark-mod/ArkBot
ARK Survival Evolved application that monitors and extracts data from local ARK servers and exposes this data through a Web App, Web API and Discord Bot. Provides important functions to players: dino listings, food-status, breeding info, statistics; and server admins: rcon-commands, server managing etc.
|
|
zone117x/Jackett
Use just about any tracker with Sonarr
|
|
JSONAPIdotNET/JSONAPI.NET
|
Version | Downloads | Last updated |
---|---|---|
6.2.1 | 284,110 | 7/13/2023 |
6.2.0 | 60,558 | 4/11/2023 |
6.1.0 | 263,937 | 8/2/2022 |
6.0.0 | 1,274,317 | 10/5/2020 |
5.0.0 | 984,351 | 1/31/2020 |
4.0.0 | 6,235,223 | 8/17/2016 |
4.0.0-beta7-221 | 8,086 | 10/1/2015 |
3.3.0 | 545,743 | 9/8/2015 |
3.2.0 | 269,714 | 8/21/2014 |
3.1.0 | 6,292 | 8/17/2014 |
3.0.1 | 11,341 | 6/20/2014 |
3.0.0 | 4,810 | 6/20/2014 |
3.0.0-alpha3 | 2,157 | 3/27/2014 |
3.0.0-alpha2 | 1,340 | 3/26/2014 |
3.0.0-alpha | 1,526 | 2/17/2014 |
Release notes are at https://github.com/autofac/Autofac.WebApi.Owin/releases