# dotnet/samples architecture

> Architecture diagram of the GitHub repository dotnet/samples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dotnet/samples
- Repository: https://github.com/dotnet/samples

## Overview

This repository is a catalog of .NET documentation samples, not one application with a shared runtime. A reader follows a documentation topic to a sample project and runs that project; the samples then demonstrate independent language, runtime, cloud, web, and device scenarios. The graph highlights those capability areas and evidenced sample-level calls. Many projects are represented only by their directory because their source was not sampled; their internal wiring is therefore omitted.

Main entry points: [`csharp/indexers/Program.cs`](https://github.com/dotnet/samples/blob/main/csharp/indexers/Program.cs) (Indexer examples), [`orleans/Voting/Controllers/VotesController.cs`](https://github.com/dotnet/samples/blob/main/orleans/Voting/Controllers/VotesController.cs) (Voting API), [`iot/morse-dotnet/MorseReceive/Program.cs`](https://github.com/dotnet/samples/blob/main/iot/morse-dotnet/MorseReceive/Program.cs) (Morse receiver), [`csharp/indexers/SampleOne/DataSamples.cs`](https://github.com/dotnet/samples/blob/main/csharp/indexers/SampleOne/DataSamples.cs) (Paged data store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_language["C&#35; language"]
  node_indexers["Indexer examples<br/>[Program.cs]"]
  node_indexerdata["Paged data store<br/>[DataSamples.cs]"]
  node_weather["Weather records"]
  node_measurements["Measurement model<br/>[Measurements.cs]"]
  node_patternmatching["Pattern matching"]
  node_linq["LINQ samples"]
  node_expressiontrees["Expression trees"]
  node_nullable["Nullable types<br/>[Program.cs]"]
end

subgraph group_runtime["Runtime features"]
  node_pipeline["Parallel pipeline<br/>[Pipeline.cs]"]
  node_async["Async examples"]
  node_json["JSON processing<br/>[Program.cs]"]
  node_diagnostics["Diagnostic scenarios"]
  node_interop["Stream interop<br/>[Assembly.cs]"]
end

subgraph group_cloudweb["Cloud and web"]
  node_azureidentity["Azure provisioning<br/>[Program.cs]"]
  node_dynamicconfig["Dynamic configuration"]
  node_appinsights["Application Insights"]
end

subgraph group_distributed["Distributed and IoT"]
  node_votingapi["Voting API<br/>[VotesController.cs]"]
  node_votegrain["Vote grain contract<br/>[IVoteGrain.cs]"]
  node_device["IoT device sample<br/>[Program.cs]"]
  node_morse["Morse receiver<br/>[Program.cs]"]
  node_morsedata["Morse dictionary<br/>[Common.cs]"]
end

subgraph group_frameworks["Framework scenarios"]
  node_durable["Durable instances<br/>[StorageManagers.cs]"]
  node_approval["Document approval<br/>[UserManager.cs]"]
  node_workers["Background workers"]
  node_com["COM interop"]
end

node_reader(("Documentation reader"))
node_samples["Sample catalog"]

node_reader -->|"chooses topic"| node_samples
node_samples -->|"provides examples"| node_indexers
node_samples -->|"provides examples"| node_linq
node_samples -->|"provides examples"| node_async
node_samples -->|"provides examples"| node_azureidentity
node_samples -->|"provides examples"| node_votingapi
node_samples -->|"provides examples"| node_device
node_samples -->|"provides examples"| node_durable
node_indexers -->|"creates and accesses"| node_indexerdata
node_indexers -->|"creates and accesses"| node_weather
node_indexers -->|"assigns values"| node_measurements
node_votingapi -->|"calls grain"| node_votegrain
node_morse -->|"uses dictionary"| node_morsedata

click node_indexers "https://github.com/dotnet/samples/blob/main/csharp/indexers/Program.cs"
click node_indexerdata "https://github.com/dotnet/samples/blob/main/csharp/indexers/SampleOne/DataSamples.cs"
click node_weather "https://github.com/dotnet/samples/blob/main/csharp/indexers/SampleFour/HistoricalWeatherData.cs"
click node_measurements "https://github.com/dotnet/samples/blob/main/csharp/indexers/Common/Measurements.cs"
click node_patternmatching "https://github.com/dotnet/samples/blob/main/csharp/PatternMatching/GeometricUtilities.cs"
click node_linq "https://github.com/dotnet/samples/tree/main/core/linq/csharp"
click node_expressiontrees "https://github.com/dotnet/samples/tree/main/csharp/expression-trees"
click node_nullable "https://github.com/dotnet/samples/blob/main/csharp/NullableIntroduction/NullableIntroduction/Program.cs"
click node_pipeline "https://github.com/dotnet/samples/blob/main/csharp/parallel/ParallelExtensionsExtras/CoordinationDataStructures/Pipeline.cs"
click node_async "https://github.com/dotnet/samples/tree/main/async/async-and-await/cs"
click node_json "https://github.com/dotnet/samples/blob/main/core/json/Program.cs"
click node_diagnostics "https://github.com/dotnet/samples/blob/main/core/diagnostics/DiagnosticScenarios/Controllers/DiagnosticScenarios.cs"
click node_interop "https://github.com/dotnet/samples/blob/main/core/interop/Streams/Shared/Assembly.cs"
click node_azureidentity "https://github.com/dotnet/samples/blob/main/azure/sdk-identity-resources-storage/Program.cs"
click node_dynamicconfig "https://github.com/dotnet/samples/tree/main/azure/app-configuration-dynamic-reload"
click node_appinsights "https://github.com/dotnet/samples/tree/main/azure/app-insights-aspnet-core-quickstart"
click node_votingapi "https://github.com/dotnet/samples/blob/main/orleans/Voting/Controllers/VotesController.cs"
click node_votegrain "https://github.com/dotnet/samples/blob/main/orleans/Voting/Grains/IVoteGrain.cs"
click node_device "https://github.com/dotnet/samples/blob/main/iot/cheesecave.net/Program.cs"
click node_morse "https://github.com/dotnet/samples/blob/main/iot/morse-dotnet/MorseReceive/Program.cs"
click node_morsedata "https://github.com/dotnet/samples/blob/main/iot/morse-dotnet/MorseCommon/Common.cs"
click node_durable "https://github.com/dotnet/samples/blob/main/framework/wcf/Extensibility/Instancing/Durable/CS/extensions/StorageManagers.cs"
click node_approval "https://github.com/dotnet/samples/blob/main/framework/windows-workflow-foundation/application/DocumentApprovalProcess/CS/ApprovalManager/UserManager.cs"
click node_workers "https://github.com/dotnet/samples/tree/main/core/workers"
click node_com "https://github.com/dotnet/samples/tree/main/core/extensions/COMServerDemo"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_indexers,node_indexerdata,node_weather,node_measurements,node_patternmatching,node_linq,node_expressiontrees,node_nullable toneBlue
class node_pipeline,node_async,node_json,node_diagnostics,node_interop toneAmber
class node_azureidentity,node_dynamicconfig,node_appinsights toneMint
class node_votingapi,node_votegrain,node_device,node_morse,node_morsedata toneRose
class node_durable,node_approval,node_workers,node_com,node_reader,node_samples toneIndigo
```

## Components

### C# language

- [Indexer examples](https://github.com/dotnet/samples/blob/main/csharp/indexers/Program.cs): `csharp/indexers/Program.cs`
- [Paged data store](https://github.com/dotnet/samples/blob/main/csharp/indexers/SampleOne/DataSamples.cs): `csharp/indexers/SampleOne/DataSamples.cs`
- [Weather records](https://github.com/dotnet/samples/blob/main/csharp/indexers/SampleFour/HistoricalWeatherData.cs): `csharp/indexers/SampleFour/HistoricalWeatherData.cs`
- [Measurement model](https://github.com/dotnet/samples/blob/main/csharp/indexers/Common/Measurements.cs): `csharp/indexers/Common/Measurements.cs`
- [Pattern matching](https://github.com/dotnet/samples/blob/main/csharp/PatternMatching/GeometricUtilities.cs): `csharp/PatternMatching/GeometricUtilities.cs`
- [LINQ samples](https://github.com/dotnet/samples/tree/main/core/linq/csharp): `core/linq/csharp`
- [Expression trees](https://github.com/dotnet/samples/tree/main/csharp/expression-trees): `csharp/expression-trees`
- [Nullable types](https://github.com/dotnet/samples/blob/main/csharp/NullableIntroduction/NullableIntroduction/Program.cs): `csharp/NullableIntroduction/NullableIntroduction/Program.cs`

### Runtime features

- [Parallel pipeline](https://github.com/dotnet/samples/blob/main/csharp/parallel/ParallelExtensionsExtras/CoordinationDataStructures/Pipeline.cs): `csharp/parallel/ParallelExtensionsExtras/CoordinationDataStructures/Pipeline.cs`
- [Async examples](https://github.com/dotnet/samples/tree/main/async/async-and-await/cs): `async/async-and-await/cs`
- [JSON processing](https://github.com/dotnet/samples/blob/main/core/json/Program.cs): `core/json/Program.cs`
- [Diagnostic scenarios](https://github.com/dotnet/samples/blob/main/core/diagnostics/DiagnosticScenarios/Controllers/DiagnosticScenarios.cs): `core/diagnostics/DiagnosticScenarios/Controllers/DiagnosticScenarios.cs`
- [Stream interop](https://github.com/dotnet/samples/blob/main/core/interop/Streams/Shared/Assembly.cs): `core/interop/Streams/Shared/Assembly.cs`

### Cloud and web

- [Azure provisioning](https://github.com/dotnet/samples/blob/main/azure/sdk-identity-resources-storage/Program.cs): `azure/sdk-identity-resources-storage/Program.cs`
- [Dynamic configuration](https://github.com/dotnet/samples/tree/main/azure/app-configuration-dynamic-reload): `azure/app-configuration-dynamic-reload`
- [Application Insights](https://github.com/dotnet/samples/tree/main/azure/app-insights-aspnet-core-quickstart): `azure/app-insights-aspnet-core-quickstart`

### Distributed and IoT

- [Voting API](https://github.com/dotnet/samples/blob/main/orleans/Voting/Controllers/VotesController.cs): `orleans/Voting/Controllers/VotesController.cs`
- [Vote grain contract](https://github.com/dotnet/samples/blob/main/orleans/Voting/Grains/IVoteGrain.cs): `orleans/Voting/Grains/IVoteGrain.cs`
- [IoT device sample](https://github.com/dotnet/samples/blob/main/iot/cheesecave.net/Program.cs): `iot/cheesecave.net/Program.cs`
- [Morse receiver](https://github.com/dotnet/samples/blob/main/iot/morse-dotnet/MorseReceive/Program.cs): `iot/morse-dotnet/MorseReceive/Program.cs`
- [Morse dictionary](https://github.com/dotnet/samples/blob/main/iot/morse-dotnet/MorseCommon/Common.cs): `iot/morse-dotnet/MorseCommon/Common.cs`

### Framework scenarios

- [Durable instances](https://github.com/dotnet/samples/blob/main/framework/wcf/Extensibility/Instancing/Durable/CS/extensions/StorageManagers.cs): `framework/wcf/Extensibility/Instancing/Durable/CS/extensions/StorageManagers.cs`
- [Document approval](https://github.com/dotnet/samples/blob/main/framework/windows-workflow-foundation/application/DocumentApprovalProcess/CS/ApprovalManager/UserManager.cs): `framework/windows-workflow-foundation/application/DocumentApprovalProcess/CS/ApprovalManager/UserManager.cs`
- [Background workers](https://github.com/dotnet/samples/tree/main/core/workers): `core/workers`
- [COM interop](https://github.com/dotnet/samples/tree/main/core/extensions/COMServerDemo): `core/extensions/COMServerDemo`

### Other components

- **Documentation reader**
- **Sample catalog**

## Connections

- Documentation reader → Sample catalog: chooses topic (evidence: `README.md`)
- Sample catalog → Indexer examples: provides examples (evidence: `README.md`)
- Sample catalog → LINQ samples: provides examples (evidence: `README.md`)
- Sample catalog → Async examples: provides examples (evidence: `README.md`)
- Sample catalog → Azure provisioning: provides examples (evidence: `README.md`)
- Sample catalog → Voting API: provides examples (evidence: `README.md`)
- Sample catalog → IoT device sample: provides examples (evidence: `README.md`)
- Sample catalog → Durable instances: provides examples (evidence: `README.md`)
- Indexer examples → Paged data store: creates and accesses (evidence: `csharp/indexers/Program.cs`)
- Indexer examples → Weather records: creates and accesses (evidence: `csharp/indexers/Program.cs`)
- Indexer examples → Measurement model: assigns values (evidence: `csharp/indexers/Program.cs`)
- Voting API → Vote grain contract: calls grain (evidence: `orleans/Voting/Controllers/VotesController.cs`)
- Morse receiver → Morse dictionary: uses dictionary (evidence: `iot/morse-dotnet/MorseReceive/Program.cs`)
