Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
495 changes: 296 additions & 199 deletions .editorconfig

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

# Convert to file-scoped namespaces.
ccd9b352d4066839cbe2dff010df6ab464ea871e

# Normalize whitespace and JSON key order via pre-commit.
39b63732ecc81559303a7f1ab9d1283c37b279c9
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*.png binary
*.gif binary

*.cs text=auto diff=csharp
*.cs text=auto diff=csharp
*.vb text=auto
*.resx text=auto
*.c text=auto
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ on:
push:
branches:
- main
- develop
- "feature/**"
pull_request:
branches:
- develop
- main

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"MD013": false
}
12 changes: 11 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Vendored scripts, generated WCF proxies, and designer files are tool output we
# never hand-edit. Normalizing them just gets undone the next time a tool rewrites
# them.
exclude: |
(?x)^(
src/[^/]+/Scripts/|
src/[^/]+/Service\ References/|
src/WebFormsExample/.*\.designer\.cs$
)

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0
Expand All @@ -8,7 +18,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: "e72a3ca1632f0b11a07d171449fe447a7ff6795e" # frozen: v0.48.0
rev: "5b5dddc4fb0f83c3ea1fc5616fa63e115dce83e0" # frozen: v0.49.1
hooks:
- id: markdownlint
args:
Expand Down
210 changes: 105 additions & 105 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,105 +1,105 @@
{
"configurations": [
{
"cwd": "${workspaceFolder}/src/AspNetCore3Example",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"name": "AspNetCore3Example",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AspNetCore3Example/bin/Debug/netcoreapp3.1/AspNetCore3Example.dll",
"request": "launch",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/api/Values"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
},
"stopAtEntry": false,
"type": "coreclr"
},
{
"cwd": "${workspaceFolder}/src/AspNetCore3ChildLifetimeScope",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"name": "AspNetCore3ChildLifetimeScope",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AspNetCore3ChildLifetimeScope/bin/Debug/netcoreapp3.1/AspNetCore3ChildLifetimeScope.dll",
"request": "launch",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/api/ApplicationA"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
},
"stopAtEntry": false,
"type": "coreclr"
},
{
"cwd": "${workspaceFolder}/src/AspNetCoreExample",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"name": "AspNetCoreExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AspNetCoreExample/bin/Debug/net6.0/AspNetCoreExample.dll",
"request": "launch",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/api/Values"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
},
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/AttributeMetadataExample",
"name": "AttributeMetadataExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AttributeMetadataExample/bin/Debug/net6.0/AttributeMetadataExample.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/ConfigurationExample",
"name": "ConfigurationExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/ConfigurationExample/bin/Debug/net6.0/ConfigurationExample.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/GenericHostBuilderExample",
"name": "GenericHostBuilderExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/GenericHostBuilderExample/bin/Debug/net6.0/GenericHostBuilderExample.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/MultitenantExample.ConsoleApplication",
"name": "MultitenantExample.ConsoleApplication",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/MultitenantExample.ConsoleApplication/bin/Debug/net6.0/MultitenantExample.ConsoleApplication.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
}
],
"version": "0.2.0"
}
{
"configurations": [
{
"cwd": "${workspaceFolder}/src/AspNetCore3Example",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"name": "AspNetCore3Example",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AspNetCore3Example/bin/Debug/netcoreapp3.1/AspNetCore3Example.dll",
"request": "launch",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/api/Values"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
},
"stopAtEntry": false,
"type": "coreclr"
},
{
"cwd": "${workspaceFolder}/src/AspNetCore3ChildLifetimeScope",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"name": "AspNetCore3ChildLifetimeScope",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AspNetCore3ChildLifetimeScope/bin/Debug/netcoreapp3.1/AspNetCore3ChildLifetimeScope.dll",
"request": "launch",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/api/ApplicationA"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
},
"stopAtEntry": false,
"type": "coreclr"
},
{
"cwd": "${workspaceFolder}/src/AspNetCoreExample",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"name": "AspNetCoreExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AspNetCoreExample/bin/Debug/net6.0/AspNetCoreExample.dll",
"request": "launch",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/api/Values"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
},
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/AttributeMetadataExample",
"name": "AttributeMetadataExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AttributeMetadataExample/bin/Debug/net6.0/AttributeMetadataExample.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/ConfigurationExample",
"name": "ConfigurationExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/ConfigurationExample/bin/Debug/net6.0/ConfigurationExample.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/GenericHostBuilderExample",
"name": "GenericHostBuilderExample",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/GenericHostBuilderExample/bin/Debug/net6.0/GenericHostBuilderExample.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/src/MultitenantExample.ConsoleApplication",
"name": "MultitenantExample.ConsoleApplication",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/MultitenantExample.ConsoleApplication/bin/Debug/net6.0/MultitenantExample.ConsoleApplication.dll",
"request": "launch",
"stopAtEntry": false,
"type": "coreclr"
}
],
"version": "0.2.0"
}
4 changes: 3 additions & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Before You File

Try StackOverflow! If you have a _usage question_ ("How do I...?" "Others have this working but I can't get it...") please try [StackOverflow](https://stackoverflow.com) and tag your question `autofac`. We, along with a great community, monitor those questions.

**Have you [read the docs?](https://autofac.readthedocs.io/)**

**This repo is for Autofac example issues only.** If you found a bug in the examples or have an idea for a new example that would be helpful, you're in the right place. Everything else, please file it in the appropriate repo or ask questions on StackOverflow. Thanks!
**This repo is for Autofac example issues only.** If you found a bug in the examples or have an idea for a new example that would be helpful, you're in the right place. Everything else, please file it in the appropriate repo or ask questions on StackOverflow. Thanks!
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Example projects that consume and demonstrate [Autofac](https://autofac.org) functionality and integration.

[![Build status](https://ci.appveyor.com/api/projects/status/ckc94rt42bfhdt6j?svg=true)](https://ci.appveyor.com/project/Autofac/examples)
[![Build status](https://github.com/autofac/Examples/actions/workflows/ci.yml/badge.svg)](https://github.com/autofac/Examples/actions/workflows/ci.yml)

## Reading the Examples

Expand All @@ -14,4 +14,4 @@ The examples attempt to stick pretty close to the [Autofac documentation](https:

## Building the Examples

The `Examples.sln` file has all the samples in it _except_ the ServiceFabric example. ServiceFabric is in a child directory and has its own solution.
`Examples.slnx` contains every sample. The ASP.NET MVC, Web Forms, WCF, and OWIN self-host samples target .NET Framework, so building the whole solution requires Windows; the rest build anywhere.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"rollForward": "latestFeature",
"version": "10.0.203"
"version": "10.0.100"
}
}
12 changes: 6 additions & 6 deletions src/ConfigurationExample/autofac.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"defaultAssembly": "ConfigurationExample",
"components": [
{
"type": "ConfigurationExample.InternalPlugin",
"services": [
{
"type": "ConfigurationExample.InternalPlugin"
},
{
"type": "ConfigurationExampleInterface.IPlugin, ConfigurationExampleInterface"
}
]
],
"type": "ConfigurationExample.InternalPlugin"
},
{
"type": "ConfigurationExamplePlugin.ExternalPlugin, ConfigurationExamplePlugin",
"services": [
{
"type": "ConfigurationExampleInterface.IPlugin, ConfigurationExampleInterface"
}
]
],
"type": "ConfigurationExamplePlugin.ExternalPlugin, ConfigurationExamplePlugin"
}
]
],
"defaultAssembly": "ConfigurationExample"
}
2 changes: 1 addition & 1 deletion src/GenericHostBuilderExample/HostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public async Task StopAsync(CancellationToken cancellationToken)
await _logger.Log("Stopping hosted service");
}
}
}
}
2 changes: 1 addition & 1 deletion src/GenericHostBuilderExample/ILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ internal interface ILogger
{
Task Log(string value);
}
}
}
2 changes: 1 addition & 1 deletion src/GenericHostBuilderExample/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public async Task Log(string value)
await Console.Out.WriteLineAsync($"Logger: {value}");
}
}
}
}
Loading