From 666804f82e29bb286a706415a460bd95191a709b Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Tue, 1 Sep 2026 10:38:22 -0700 Subject: [PATCH 1/2] Add a README per example and an index in the root README Fifteen example directories with no way to tell them apart without opening the source. Each now has a short README saying what it demonstrates, which packages it needs, how to run it, and which documentation page it follows. The root README groups them into a table so the repo is browsable from the top. The three ASP.NET Core examples all target the same doc page and differ only in hosting shape, so each README says how it differs from its siblings rather than repeating the same summary three times. Examples.slnx groups projects by area instead of one flat src folder. The src layout itself is unchanged, because moving directories would break every inbound link from the documentation for no gain. Part of #32 --- Examples.slnx | 6 +++- README.md | 36 +++++++++++++++++++ src/AspNetCoreChildLifetimeScope/README.md | 9 +++++ src/AspNetCoreExample/README.md | 9 +++++ src/AspNetCoreNoStartupExample/README.md | 9 +++++ src/AttributeMetadataExample/README.md | 9 +++++ src/ConfigurationExample/README.md | 9 +++++ src/ConfigurationExampleInterface/README.md | 5 +++ src/ConfigurationExamplePlugin/README.md | 5 +++ src/GenericHostBuilderExample/README.md | 9 +++++ .../README.md | 9 +++++ .../README.md | 9 +++++ src/MultitenantExample.WcfService/README.md | 9 +++++ src/MvcExample/README.md | 9 +++++ src/WcfExample/README.md | 9 +++++ src/WebApiExample.OwinSelfHost/README.md | 9 +++++ src/WebFormsExample/README.md | 9 +++++ 17 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 src/AspNetCoreChildLifetimeScope/README.md create mode 100644 src/AspNetCoreExample/README.md create mode 100644 src/AspNetCoreNoStartupExample/README.md create mode 100644 src/AttributeMetadataExample/README.md create mode 100644 src/ConfigurationExample/README.md create mode 100644 src/ConfigurationExampleInterface/README.md create mode 100644 src/ConfigurationExamplePlugin/README.md create mode 100644 src/GenericHostBuilderExample/README.md create mode 100644 src/MultitenantExample.ConsoleApplication/README.md create mode 100644 src/MultitenantExample.MvcApplication/README.md create mode 100644 src/MultitenantExample.WcfService/README.md create mode 100644 src/MvcExample/README.md create mode 100644 src/WcfExample/README.md create mode 100644 src/WebApiExample.OwinSelfHost/README.md create mode 100644 src/WebFormsExample/README.md diff --git a/Examples.slnx b/Examples.slnx index 1ba0db1..f2fb6b6 100644 --- a/Examples.slnx +++ b/Examples.slnx @@ -1,14 +1,18 @@ - + + + + + diff --git a/README.md b/README.md index 134ca09..f55d50f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,42 @@ Example projects that consume and demonstrate [Autofac](https://autofac.org) fun [![Build status](https://github.com/autofac/Examples/actions/workflows/ci.yml/badge.svg)](https://github.com/autofac/Examples/actions/workflows/ci.yml) +## The Examples + +Each example has its own README with what it shows and how to run it. + +### ASP.NET Core + +| Example | Demonstrates | Packages | +| --- | --- | --- | +| [AspNetCoreExample](src/AspNetCoreExample/README.md) | A `Startup` class whose `ConfigureContainer` takes a `ContainerBuilder` | `Autofac.Extensions.DependencyInjection` | +| [AspNetCoreNoStartupExample](src/AspNetCoreNoStartupExample/README.md) | The same wiring in the minimal hosting model, with no `Startup` class | `Autofac.Extensions.DependencyInjection` | +| [AspNetCoreChildLifetimeScope](src/AspNetCoreChildLifetimeScope/README.md) | Two hosts sharing one container, each rooted in its own child scope | `Autofac.Extensions.DependencyInjection` | + +### Hosting and core features + +| Example | Demonstrates | Packages | +| --- | --- | --- | +| [GenericHostBuilderExample](src/GenericHostBuilderExample/README.md) | The generic host without ASP.NET Core, for worker services | `Autofac.Extensions.DependencyInjection` | +| [ConfigurationExample](src/ConfigurationExample/README.md) | Registering from `autofac.json`, including an unreferenced plugin assembly | `Autofac.Configuration` | +| [AttributeMetadataExample](src/AttributeMetadataExample/README.md) | Metadata by string, class, interface, and attribute, then filtering on it | `Autofac.Extras.AttributeMetadata` | +| [MultitenantExample.ConsoleApplication](src/MultitenantExample.ConsoleApplication/README.md) | Per-tenant overrides with no web request in sight | `Autofac.Multitenant` | + +### .NET Framework + +These target `net481` and need Windows. Most run under IIS Express from Visual Studio. + +| Example | Demonstrates | Packages | +| --- | --- | --- | +| [MvcExample](src/MvcExample/README.md) | MVC 5 controllers, action filters, and view pages, plus a WCF client | `Autofac.Mvc5`, `Autofac.Wcf` | +| [WebFormsExample](src/WebFormsExample/README.md) | Property injection into pages that cannot take constructor arguments | `Autofac.Web` | +| [WcfExample](src/WcfExample/README.md) | A WCF service whose implementation is resolved from the container | `Autofac.Wcf` | +| [WebApiExample.OwinSelfHost](src/WebApiExample.OwinSelfHost/README.md) | Web API 2 self-hosted under OWIN instead of IIS | `Autofac.Owin`, `Autofac.WebApi2`, `Autofac.WebApi2.Owin` | +| [MultitenantExample.WcfService](src/MultitenantExample.WcfService/README.md) | A WCF service resolving a different implementation per tenant | `Autofac.Multitenant.Wcf`, `Autofac.Wcf` | +| [MultitenantExample.MvcApplication](src/MultitenantExample.MvcApplication/README.md) | The client half, carrying tenant identity across the service boundary | `Autofac.Multitenant`, `Autofac.Mvc5` | + +`ConfigurationExampleInterface` and `ConfigurationExamplePlugin` are supporting libraries for `ConfigurationExample` rather than examples themselves. + ## Reading the Examples The examples in the repo are always for the latest Autofac versions and libraries. Look at the tags on this repo to see examples for older and/or deprecated functionality. diff --git a/src/AspNetCoreChildLifetimeScope/README.md b/src/AspNetCoreChildLifetimeScope/README.md new file mode 100644 index 0000000..089b002 --- /dev/null +++ b/src/AspNetCoreChildLifetimeScope/README.md @@ -0,0 +1,9 @@ +# AspNetCoreChildLifetimeScope + +Two ASP.NET Core hosts in one process, each rooted in its own child lifetime scope over a shared container, so both reach the same singletons while keeping their own per-application registrations. + +Packages: `Autofac.Extensions.DependencyInjection` + +Run `dotnet run --project src/AspNetCoreChildLifetimeScope`, then browse to and . + +See [ASP.NET Core](https://autofac.readthedocs.io/en/latest/integration/aspnetcore.html) for the documentation this example follows. diff --git a/src/AspNetCoreExample/README.md b/src/AspNetCoreExample/README.md new file mode 100644 index 0000000..d3ca60d --- /dev/null +++ b/src/AspNetCoreExample/README.md @@ -0,0 +1,9 @@ +# AspNetCoreExample + +Wiring Autofac into ASP.NET Core through a `Startup` class, where `ConfigureContainer` receives a strongly-typed `ContainerBuilder` and registrations are grouped into a module. + +Packages: `Autofac.Extensions.DependencyInjection` + +Run `dotnet run --project src/AspNetCoreExample`, then browse to . + +See [ASP.NET Core](https://autofac.readthedocs.io/en/latest/integration/aspnetcore.html) for the documentation this example follows. diff --git a/src/AspNetCoreNoStartupExample/README.md b/src/AspNetCoreNoStartupExample/README.md new file mode 100644 index 0000000..a776090 --- /dev/null +++ b/src/AspNetCoreNoStartupExample/README.md @@ -0,0 +1,9 @@ +# AspNetCoreNoStartupExample + +The same wiring as `AspNetCoreExample` using the minimal hosting model, with everything configured inline in `Program.cs` and no `Startup` class. Read the two side by side to see what the `Startup` class does and does not buy you. + +Packages: `Autofac.Extensions.DependencyInjection` + +Run `dotnet run --project src/AspNetCoreNoStartupExample`, then browse to . + +See [ASP.NET Core](https://autofac.readthedocs.io/en/latest/integration/aspnetcore.html) for the documentation this example follows. diff --git a/src/AttributeMetadataExample/README.md b/src/AttributeMetadataExample/README.md new file mode 100644 index 0000000..3b5cfcc --- /dev/null +++ b/src/AttributeMetadataExample/README.md @@ -0,0 +1,9 @@ +# AttributeMetadataExample + +Four ways to attach metadata to a registration -- loose strings, a strongly-typed class, an interface, and attributes -- and then filtering on it at the point of injection. + +Packages: `Autofac`, `Autofac.Extras.AttributeMetadata` + +Run `dotnet run --project src/AttributeMetadataExample`. It writes one line per metadata style. + +See [Component Metadata](https://autofac.readthedocs.io/en/latest/advanced/metadata.html) for the documentation this example follows. diff --git a/src/ConfigurationExample/README.md b/src/ConfigurationExample/README.md new file mode 100644 index 0000000..8372989 --- /dev/null +++ b/src/ConfigurationExample/README.md @@ -0,0 +1,9 @@ +# ConfigurationExample + +Registering components from `autofac.json` rather than in code, including a plugin assembly the application holds no reference to at all. + +Packages: `Autofac`, `Autofac.Configuration` + +Run `dotnet run --project src/ConfigurationExample`. It prints the plugins it resolved from configuration. + +See [JSON/XML Configuration](https://autofac.readthedocs.io/en/latest/configuration/xml.html) for the documentation this example follows. diff --git a/src/ConfigurationExampleInterface/README.md b/src/ConfigurationExampleInterface/README.md new file mode 100644 index 0000000..ceacc28 --- /dev/null +++ b/src/ConfigurationExampleInterface/README.md @@ -0,0 +1,5 @@ +# ConfigurationExampleInterface + +The shared interface that `ConfigurationExample` and `ConfigurationExamplePlugin` both compile against. It exists so the plugin can be loaded by configuration without the application referencing it directly. + +Not a standalone example -- see [ConfigurationExample](../ConfigurationExample/README.md). diff --git a/src/ConfigurationExamplePlugin/README.md b/src/ConfigurationExamplePlugin/README.md new file mode 100644 index 0000000..d71c002 --- /dev/null +++ b/src/ConfigurationExamplePlugin/README.md @@ -0,0 +1,5 @@ +# ConfigurationExamplePlugin + +A plugin assembly deliberately not referenced by `ConfigurationExample`. It gets copied into the output folder and loaded by name from `autofac.json`, which is the whole point being demonstrated. + +Not a standalone example -- see [ConfigurationExample](../ConfigurationExample/README.md). diff --git a/src/GenericHostBuilderExample/README.md b/src/GenericHostBuilderExample/README.md new file mode 100644 index 0000000..8d374ef --- /dev/null +++ b/src/GenericHostBuilderExample/README.md @@ -0,0 +1,9 @@ +# GenericHostBuilderExample + +Autofac under the generic host, without ASP.NET Core in the picture. This is the shape to copy for a worker service or a console application that wants hosted services and configuration. + +Packages: `Autofac.Extensions.DependencyInjection` + +Run `dotnet run --project src/GenericHostBuilderExample`. It starts a hosted service and runs until you press Ctrl+C. + +See [.NET Core](https://autofac.readthedocs.io/en/latest/integration/netcore.html) for the documentation this example follows. diff --git a/src/MultitenantExample.ConsoleApplication/README.md b/src/MultitenantExample.ConsoleApplication/README.md new file mode 100644 index 0000000..ec54446 --- /dev/null +++ b/src/MultitenantExample.ConsoleApplication/README.md @@ -0,0 +1,9 @@ +# MultitenantExample.ConsoleApplication + +Per-tenant registration overrides outside a web application, showing that multitenancy is not tied to a request pipeline. Switch tenants interactively and watch which dependency and lifetime you get. + +Packages: `Autofac`, `Autofac.Multitenant` + +Run `dotnet run --project src/MultitenantExample.ConsoleApplication` and press 1-9 to pick a tenant, or 0 for the default tenant. + +See [Multitenant Applications](https://autofac.readthedocs.io/en/latest/advanced/multitenant.html) for the documentation this example follows. diff --git a/src/MultitenantExample.MvcApplication/README.md b/src/MultitenantExample.MvcApplication/README.md new file mode 100644 index 0000000..5453c3c --- /dev/null +++ b/src/MultitenantExample.MvcApplication/README.md @@ -0,0 +1,9 @@ +# MultitenantExample.MvcApplication + +The client half of the multitenant WCF example: a multitenant MVC application that also passes its tenant identity across the service boundary. + +Packages: `Autofac`, `Autofac.Multitenant`, `Autofac.Multitenant.Wcf`, `Autofac.Mvc5`, `Autofac.Wcf` + +Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express, with `MultitenantExample.WcfService` running as well. + +See [Multitenant Applications](https://autofac.readthedocs.io/en/latest/advanced/multitenant.html) for the documentation this example follows. diff --git a/src/MultitenantExample.WcfService/README.md b/src/MultitenantExample.WcfService/README.md new file mode 100644 index 0000000..860715b --- /dev/null +++ b/src/MultitenantExample.WcfService/README.md @@ -0,0 +1,9 @@ +# MultitenantExample.WcfService + +A WCF service that resolves a different implementation per tenant, including how the tenant is identified from the incoming message. + +Packages: `Autofac`, `Autofac.Multitenant`, `Autofac.Multitenant.Wcf`, `Autofac.Wcf` + +Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express. `MultitenantExample.MvcApplication` is its client. + +See [Multitenant Applications](https://autofac.readthedocs.io/en/latest/advanced/multitenant.html) for the documentation this example follows. diff --git a/src/MvcExample/README.md b/src/MvcExample/README.md new file mode 100644 index 0000000..14bc899 --- /dev/null +++ b/src/MvcExample/README.md @@ -0,0 +1,9 @@ +# MvcExample + +ASP.NET MVC 5 integration across controllers, action filters, and view pages. It also consumes `WcfExample`, so it doubles as an example of injecting a WCF client proxy. + +Packages: `Autofac`, `Autofac.Mvc5`, `Autofac.Wcf` + +Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express. `WcfExample` needs to be running for the index page to load. + +See [MVC](https://autofac.readthedocs.io/en/latest/integration/mvc.html) for the documentation this example follows. diff --git a/src/WcfExample/README.md b/src/WcfExample/README.md new file mode 100644 index 0000000..8fc17d7 --- /dev/null +++ b/src/WcfExample/README.md @@ -0,0 +1,9 @@ +# WcfExample + +Hosting a WCF service whose implementation is resolved from Autofac, using the service host factory. + +Packages: `Autofac`, `Autofac.Wcf` + +Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express. `MvcExample` acts as its client. + +See [Windows Communication Foundation (WCF)](https://autofac.readthedocs.io/en/latest/integration/wcf.html) for the documentation this example follows. diff --git a/src/WebApiExample.OwinSelfHost/README.md b/src/WebApiExample.OwinSelfHost/README.md new file mode 100644 index 0000000..abf038c --- /dev/null +++ b/src/WebApiExample.OwinSelfHost/README.md @@ -0,0 +1,9 @@ +# WebApiExample.OwinSelfHost + +Web API 2 running under OWIN self-hosting rather than IIS, with Autofac supplying controller dependencies through the OWIN pipeline. + +Packages: `Autofac`, `Autofac.Owin`, `Autofac.WebApi2`, `Autofac.WebApi2.Owin` + +Run `dotnet run --project src/WebApiExample.OwinSelfHost` on Windows. It self-hosts on and calls itself once on startup. + +See [OWIN](https://autofac.readthedocs.io/en/latest/integration/owin.html) for the documentation this example follows. diff --git a/src/WebFormsExample/README.md b/src/WebFormsExample/README.md new file mode 100644 index 0000000..cfe1209 --- /dev/null +++ b/src/WebFormsExample/README.md @@ -0,0 +1,9 @@ +# WebFormsExample + +Property injection into Web Forms pages, which cannot take constructor dependencies, by way of an HTTP module. + +Packages: `Autofac`, `Autofac.Web` + +Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express. + +See [Web Forms](https://autofac.readthedocs.io/en/latest/integration/webforms.html) for the documentation this example follows. From d5252e124e0cafb8387ddba58bef7ee8287eda49 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Tue, 1 Sep 2026 11:10:43 -0700 Subject: [PATCH 2/2] Link package names to the repositories that own them Three of the twelve package IDs don't match their repository name, so the map is explicit rather than derived: Autofac.Mvc5 lives in Autofac.Mvc, Autofac.WebApi2 in Autofac.WebApi, and Autofac.WebApi2.Owin in Autofac.WebApi.Owin. Every link is verified against the origin remote of the corresponding clone. Part of #32 --- README.md | 26 +++++++++---------- src/AspNetCoreChildLifetimeScope/README.md | 2 +- src/AspNetCoreExample/README.md | 2 +- src/AspNetCoreNoStartupExample/README.md | 2 +- src/AttributeMetadataExample/README.md | 2 +- src/ConfigurationExample/README.md | 2 +- src/GenericHostBuilderExample/README.md | 2 +- .../README.md | 2 +- .../README.md | 2 +- src/MultitenantExample.WcfService/README.md | 2 +- src/MvcExample/README.md | 2 +- src/WcfExample/README.md | 2 +- src/WebApiExample.OwinSelfHost/README.md | 2 +- src/WebFormsExample/README.md | 2 +- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index f55d50f..4cbad45 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,18 @@ Each example has its own README with what it shows and how to run it. | Example | Demonstrates | Packages | | --- | --- | --- | -| [AspNetCoreExample](src/AspNetCoreExample/README.md) | A `Startup` class whose `ConfigureContainer` takes a `ContainerBuilder` | `Autofac.Extensions.DependencyInjection` | -| [AspNetCoreNoStartupExample](src/AspNetCoreNoStartupExample/README.md) | The same wiring in the minimal hosting model, with no `Startup` class | `Autofac.Extensions.DependencyInjection` | -| [AspNetCoreChildLifetimeScope](src/AspNetCoreChildLifetimeScope/README.md) | Two hosts sharing one container, each rooted in its own child scope | `Autofac.Extensions.DependencyInjection` | +| [AspNetCoreExample](src/AspNetCoreExample/README.md) | A `Startup` class whose `ConfigureContainer` takes a `ContainerBuilder` | [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) | +| [AspNetCoreNoStartupExample](src/AspNetCoreNoStartupExample/README.md) | The same wiring in the minimal hosting model, with no `Startup` class | [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) | +| [AspNetCoreChildLifetimeScope](src/AspNetCoreChildLifetimeScope/README.md) | Two hosts sharing one container, each rooted in its own child scope | [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) | ### Hosting and core features | Example | Demonstrates | Packages | | --- | --- | --- | -| [GenericHostBuilderExample](src/GenericHostBuilderExample/README.md) | The generic host without ASP.NET Core, for worker services | `Autofac.Extensions.DependencyInjection` | -| [ConfigurationExample](src/ConfigurationExample/README.md) | Registering from `autofac.json`, including an unreferenced plugin assembly | `Autofac.Configuration` | -| [AttributeMetadataExample](src/AttributeMetadataExample/README.md) | Metadata by string, class, interface, and attribute, then filtering on it | `Autofac.Extras.AttributeMetadata` | -| [MultitenantExample.ConsoleApplication](src/MultitenantExample.ConsoleApplication/README.md) | Per-tenant overrides with no web request in sight | `Autofac.Multitenant` | +| [GenericHostBuilderExample](src/GenericHostBuilderExample/README.md) | The generic host without ASP.NET Core, for worker services | [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) | +| [ConfigurationExample](src/ConfigurationExample/README.md) | Registering from `autofac.json`, including an unreferenced plugin assembly | [`Autofac.Configuration`](https://github.com/autofac/Autofac.Configuration) | +| [AttributeMetadataExample](src/AttributeMetadataExample/README.md) | Metadata by string, class, interface, and attribute, then filtering on it | [`Autofac.Extras.AttributeMetadata`](https://github.com/autofac/Autofac.Extras.AttributeMetadata) | +| [MultitenantExample.ConsoleApplication](src/MultitenantExample.ConsoleApplication/README.md) | Per-tenant overrides with no web request in sight | [`Autofac.Multitenant`](https://github.com/autofac/Autofac.Multitenant) | ### .NET Framework @@ -31,12 +31,12 @@ These target `net481` and need Windows. Most run under IIS Express from Visual S | Example | Demonstrates | Packages | | --- | --- | --- | -| [MvcExample](src/MvcExample/README.md) | MVC 5 controllers, action filters, and view pages, plus a WCF client | `Autofac.Mvc5`, `Autofac.Wcf` | -| [WebFormsExample](src/WebFormsExample/README.md) | Property injection into pages that cannot take constructor arguments | `Autofac.Web` | -| [WcfExample](src/WcfExample/README.md) | A WCF service whose implementation is resolved from the container | `Autofac.Wcf` | -| [WebApiExample.OwinSelfHost](src/WebApiExample.OwinSelfHost/README.md) | Web API 2 self-hosted under OWIN instead of IIS | `Autofac.Owin`, `Autofac.WebApi2`, `Autofac.WebApi2.Owin` | -| [MultitenantExample.WcfService](src/MultitenantExample.WcfService/README.md) | A WCF service resolving a different implementation per tenant | `Autofac.Multitenant.Wcf`, `Autofac.Wcf` | -| [MultitenantExample.MvcApplication](src/MultitenantExample.MvcApplication/README.md) | The client half, carrying tenant identity across the service boundary | `Autofac.Multitenant`, `Autofac.Mvc5` | +| [MvcExample](src/MvcExample/README.md) | MVC 5 controllers, action filters, and view pages, plus a WCF client | [`Autofac.Mvc5`](https://github.com/autofac/Autofac.Mvc), [`Autofac.Wcf`](https://github.com/autofac/Autofac.Wcf) | +| [WebFormsExample](src/WebFormsExample/README.md) | Property injection into pages that cannot take constructor arguments | [`Autofac.Web`](https://github.com/autofac/Autofac.Web) | +| [WcfExample](src/WcfExample/README.md) | A WCF service whose implementation is resolved from the container | [`Autofac.Wcf`](https://github.com/autofac/Autofac.Wcf) | +| [WebApiExample.OwinSelfHost](src/WebApiExample.OwinSelfHost/README.md) | Web API 2 self-hosted under OWIN instead of IIS | [`Autofac.Owin`](https://github.com/autofac/Autofac.Owin), [`Autofac.WebApi2`](https://github.com/autofac/Autofac.WebApi), [`Autofac.WebApi2.Owin`](https://github.com/autofac/Autofac.WebApi.Owin) | +| [MultitenantExample.WcfService](src/MultitenantExample.WcfService/README.md) | A WCF service resolving a different implementation per tenant | [`Autofac.Multitenant.Wcf`](https://github.com/autofac/Autofac.Multitenant.Wcf), [`Autofac.Wcf`](https://github.com/autofac/Autofac.Wcf) | +| [MultitenantExample.MvcApplication](src/MultitenantExample.MvcApplication/README.md) | The client half, carrying tenant identity across the service boundary | [`Autofac.Multitenant`](https://github.com/autofac/Autofac.Multitenant), [`Autofac.Mvc5`](https://github.com/autofac/Autofac.Mvc) | `ConfigurationExampleInterface` and `ConfigurationExamplePlugin` are supporting libraries for `ConfigurationExample` rather than examples themselves. diff --git a/src/AspNetCoreChildLifetimeScope/README.md b/src/AspNetCoreChildLifetimeScope/README.md index 089b002..16b8d6f 100644 --- a/src/AspNetCoreChildLifetimeScope/README.md +++ b/src/AspNetCoreChildLifetimeScope/README.md @@ -2,7 +2,7 @@ Two ASP.NET Core hosts in one process, each rooted in its own child lifetime scope over a shared container, so both reach the same singletons while keeping their own per-application registrations. -Packages: `Autofac.Extensions.DependencyInjection` +Packages: [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) Run `dotnet run --project src/AspNetCoreChildLifetimeScope`, then browse to and . diff --git a/src/AspNetCoreExample/README.md b/src/AspNetCoreExample/README.md index d3ca60d..388c549 100644 --- a/src/AspNetCoreExample/README.md +++ b/src/AspNetCoreExample/README.md @@ -2,7 +2,7 @@ Wiring Autofac into ASP.NET Core through a `Startup` class, where `ConfigureContainer` receives a strongly-typed `ContainerBuilder` and registrations are grouped into a module. -Packages: `Autofac.Extensions.DependencyInjection` +Packages: [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) Run `dotnet run --project src/AspNetCoreExample`, then browse to . diff --git a/src/AspNetCoreNoStartupExample/README.md b/src/AspNetCoreNoStartupExample/README.md index a776090..2bcf405 100644 --- a/src/AspNetCoreNoStartupExample/README.md +++ b/src/AspNetCoreNoStartupExample/README.md @@ -2,7 +2,7 @@ The same wiring as `AspNetCoreExample` using the minimal hosting model, with everything configured inline in `Program.cs` and no `Startup` class. Read the two side by side to see what the `Startup` class does and does not buy you. -Packages: `Autofac.Extensions.DependencyInjection` +Packages: [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) Run `dotnet run --project src/AspNetCoreNoStartupExample`, then browse to . diff --git a/src/AttributeMetadataExample/README.md b/src/AttributeMetadataExample/README.md index 3b5cfcc..aa3f0e9 100644 --- a/src/AttributeMetadataExample/README.md +++ b/src/AttributeMetadataExample/README.md @@ -2,7 +2,7 @@ Four ways to attach metadata to a registration -- loose strings, a strongly-typed class, an interface, and attributes -- and then filtering on it at the point of injection. -Packages: `Autofac`, `Autofac.Extras.AttributeMetadata` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Extras.AttributeMetadata`](https://github.com/autofac/Autofac.Extras.AttributeMetadata) Run `dotnet run --project src/AttributeMetadataExample`. It writes one line per metadata style. diff --git a/src/ConfigurationExample/README.md b/src/ConfigurationExample/README.md index 8372989..d8e07bd 100644 --- a/src/ConfigurationExample/README.md +++ b/src/ConfigurationExample/README.md @@ -2,7 +2,7 @@ Registering components from `autofac.json` rather than in code, including a plugin assembly the application holds no reference to at all. -Packages: `Autofac`, `Autofac.Configuration` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Configuration`](https://github.com/autofac/Autofac.Configuration) Run `dotnet run --project src/ConfigurationExample`. It prints the plugins it resolved from configuration. diff --git a/src/GenericHostBuilderExample/README.md b/src/GenericHostBuilderExample/README.md index 8d374ef..f2578a3 100644 --- a/src/GenericHostBuilderExample/README.md +++ b/src/GenericHostBuilderExample/README.md @@ -2,7 +2,7 @@ Autofac under the generic host, without ASP.NET Core in the picture. This is the shape to copy for a worker service or a console application that wants hosted services and configuration. -Packages: `Autofac.Extensions.DependencyInjection` +Packages: [`Autofac.Extensions.DependencyInjection`](https://github.com/autofac/Autofac.Extensions.DependencyInjection) Run `dotnet run --project src/GenericHostBuilderExample`. It starts a hosted service and runs until you press Ctrl+C. diff --git a/src/MultitenantExample.ConsoleApplication/README.md b/src/MultitenantExample.ConsoleApplication/README.md index ec54446..3cf0943 100644 --- a/src/MultitenantExample.ConsoleApplication/README.md +++ b/src/MultitenantExample.ConsoleApplication/README.md @@ -2,7 +2,7 @@ Per-tenant registration overrides outside a web application, showing that multitenancy is not tied to a request pipeline. Switch tenants interactively and watch which dependency and lifetime you get. -Packages: `Autofac`, `Autofac.Multitenant` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Multitenant`](https://github.com/autofac/Autofac.Multitenant) Run `dotnet run --project src/MultitenantExample.ConsoleApplication` and press 1-9 to pick a tenant, or 0 for the default tenant. diff --git a/src/MultitenantExample.MvcApplication/README.md b/src/MultitenantExample.MvcApplication/README.md index 5453c3c..5d9f00d 100644 --- a/src/MultitenantExample.MvcApplication/README.md +++ b/src/MultitenantExample.MvcApplication/README.md @@ -2,7 +2,7 @@ The client half of the multitenant WCF example: a multitenant MVC application that also passes its tenant identity across the service boundary. -Packages: `Autofac`, `Autofac.Multitenant`, `Autofac.Multitenant.Wcf`, `Autofac.Mvc5`, `Autofac.Wcf` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Multitenant`](https://github.com/autofac/Autofac.Multitenant), [`Autofac.Multitenant.Wcf`](https://github.com/autofac/Autofac.Multitenant.Wcf), [`Autofac.Mvc5`](https://github.com/autofac/Autofac.Mvc), [`Autofac.Wcf`](https://github.com/autofac/Autofac.Wcf) Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express, with `MultitenantExample.WcfService` running as well. diff --git a/src/MultitenantExample.WcfService/README.md b/src/MultitenantExample.WcfService/README.md index 860715b..c754ff8 100644 --- a/src/MultitenantExample.WcfService/README.md +++ b/src/MultitenantExample.WcfService/README.md @@ -2,7 +2,7 @@ A WCF service that resolves a different implementation per tenant, including how the tenant is identified from the incoming message. -Packages: `Autofac`, `Autofac.Multitenant`, `Autofac.Multitenant.Wcf`, `Autofac.Wcf` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Multitenant`](https://github.com/autofac/Autofac.Multitenant), [`Autofac.Multitenant.Wcf`](https://github.com/autofac/Autofac.Multitenant.Wcf), [`Autofac.Wcf`](https://github.com/autofac/Autofac.Wcf) Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express. `MultitenantExample.MvcApplication` is its client. diff --git a/src/MvcExample/README.md b/src/MvcExample/README.md index 14bc899..9320409 100644 --- a/src/MvcExample/README.md +++ b/src/MvcExample/README.md @@ -2,7 +2,7 @@ ASP.NET MVC 5 integration across controllers, action filters, and view pages. It also consumes `WcfExample`, so it doubles as an example of injecting a WCF client proxy. -Packages: `Autofac`, `Autofac.Mvc5`, `Autofac.Wcf` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Mvc5`](https://github.com/autofac/Autofac.Mvc), [`Autofac.Wcf`](https://github.com/autofac/Autofac.Wcf) Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express. `WcfExample` needs to be running for the index page to load. diff --git a/src/WcfExample/README.md b/src/WcfExample/README.md index 8fc17d7..5ce7966 100644 --- a/src/WcfExample/README.md +++ b/src/WcfExample/README.md @@ -2,7 +2,7 @@ Hosting a WCF service whose implementation is resolved from Autofac, using the service host factory. -Packages: `Autofac`, `Autofac.Wcf` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Wcf`](https://github.com/autofac/Autofac.Wcf) Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express. `MvcExample` acts as its client. diff --git a/src/WebApiExample.OwinSelfHost/README.md b/src/WebApiExample.OwinSelfHost/README.md index abf038c..43cb108 100644 --- a/src/WebApiExample.OwinSelfHost/README.md +++ b/src/WebApiExample.OwinSelfHost/README.md @@ -2,7 +2,7 @@ Web API 2 running under OWIN self-hosting rather than IIS, with Autofac supplying controller dependencies through the OWIN pipeline. -Packages: `Autofac`, `Autofac.Owin`, `Autofac.WebApi2`, `Autofac.WebApi2.Owin` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Owin`](https://github.com/autofac/Autofac.Owin), [`Autofac.WebApi2`](https://github.com/autofac/Autofac.WebApi), [`Autofac.WebApi2.Owin`](https://github.com/autofac/Autofac.WebApi.Owin) Run `dotnet run --project src/WebApiExample.OwinSelfHost` on Windows. It self-hosts on and calls itself once on startup. diff --git a/src/WebFormsExample/README.md b/src/WebFormsExample/README.md index cfe1209..dce90af 100644 --- a/src/WebFormsExample/README.md +++ b/src/WebFormsExample/README.md @@ -2,7 +2,7 @@ Property injection into Web Forms pages, which cannot take constructor dependencies, by way of an HTTP module. -Packages: `Autofac`, `Autofac.Web` +Packages: [`Autofac`](https://github.com/autofac/Autofac), [`Autofac.Web`](https://github.com/autofac/Autofac.Web) Open `Examples.slnx` in Visual Studio on Windows and run the project under IIS Express.